Skip to content
This repository has been archived by the owner on Mar 14, 2019. It is now read-only.

Sarvesh/merkel patricia proof generator #139

Merged
merged 24 commits into from
Jul 9, 2018

Conversation

0xsarvesh
Copy link

@0xsarvesh 0xsarvesh commented Jun 27, 2018

  1. Exposed service to generate Account Proof
  2. Exposed service to generate Storage Proof
  3. Generating storage proof in batch form
  4. Using singleton instance of leveldb
  5. Using response helper and logger from openst-base
  6. Unit test cases Proof generation, db factory, helper, library etc.

#140

@0xsarvesh 0xsarvesh changed the base branch from develop to feature/proof July 3, 2018 10:19
package.json Outdated
"ethereumjs-util": "^5.2.0",
"leveldown": "^4.0.1",
"levelup": "^3.0.1",
"merkle-patricia-tree": "^2.3.1",
"node-cmd": "3.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's freeze these npm versions.

package.json Outdated
"mocha": "5.0.0"
"mocha": "5.0.0",
"mock-require": "^3.0.2",
"sinon": "^6.0.0"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also freeze these npm versions.

Copy link
Contributor

@kedarchandrayan kedarchandrayan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the changes which requested by me earlier have been incorporated. The PR looks good for merge.

Copy link

@deepesh-kn deepesh-kn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added minor comments, other than variable name StorageProof and storageProof it looks good to me.

}

describe('should generate storage proof for mapping type variable', function () {
let storageProofInstance, StorageProof, storageProof;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

variable name StorageProof and storageProof is creating confusion. We should name it better.

describe('account proof for single node', function () {
let accountProofInstance, AccountProof,accountProof;
before(async () => {
AccountProof = require(rootPrefix + '/lib/proof/account_proof')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any specific reason to have require here ? There are many such instances ex. line 48. (and also in other files.)

storageProof: function (storagePath, trie) {

let errorConf = {
internal_error_identifier: "l_p_accountProof_2",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not so critical but like to mention here.

General observation: we follow a pattern to create internal_error_identifier.
Lets take this example, file path is lib/proof/proof.js, function name is storageProof
So the internal_error_identifier will be in this case: l_p_p_storageProof_1

If we are still following pattern then we need to update internal_error_identifier at multiple locations.

@0xsarvesh 0xsarvesh requested a review from sunilkhedar July 9, 2018 09:45
Copy link
Member

@sunilkhedar sunilkhedar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sunilkhedar sunilkhedar merged commit 013b4bc into feature/proof Jul 9, 2018
@alpeshvmodi alpeshvmodi deleted the sarvesh/merkel-patricia-proof-generator branch August 30, 2018 09:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants