Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug: For extension node condition should use current path pointer #651

Merged
merged 5 commits into from
Feb 20, 2019

Conversation

0xsarvesh
Copy link
Contributor

@0xsarvesh 0xsarvesh commented Feb 20, 2019

Fixes #652

@0xsarvesh 0xsarvesh self-assigned this Feb 20, 2019
@0xsarvesh 0xsarvesh changed the base branch from develop to hotfix-0.10 February 20, 2019 09:31
Copy link
Contributor

@schemar schemar left a comment

Choose a reason for hiding this comment

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

Nice one. I think it can be improved to increase future readability, though. In case we come to this place again.
Also, does the git commit explain what the issue and the fix are? If not you could amend your commit with a better message and force push that to your branch.

contracts/lib/MerklePatriciaProof.sol Outdated Show resolved Hide resolved
contracts/lib/MerklePatriciaProof.sol Outdated Show resolved Hide resolved
contracts/lib/MerklePatriciaProof.sol Outdated Show resolved Hide resolved
Copy link
Contributor

@benjaminbollen benjaminbollen left a comment

Choose a reason for hiding this comment

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

I added some thoughts to the fix; do they make sense?

contracts/lib/MerklePatriciaProof.sol Outdated Show resolved Hide resolved
contracts/lib/MerklePatriciaProof.sol Outdated Show resolved Hide resolved
contracts/lib/MerklePatriciaProof.sol Outdated Show resolved Hide resolved
@schemar
Copy link
Contributor

schemar commented Feb 20, 2019

I just want to restate that we also need a lot of positive and negative test cases. Can we add some? Generally, any bug fix should come with at least the unit test that fails due to the bug and passes after the fix.

@0xsarvesh
Copy link
Contributor Author

I just want to restate that we also need a lot of positive and negative test cases. Can we add some? Generally, any bug fix should come with at least the unit test that fails due to the bug and passes after the fix.

I can easily add tests for the cases which kit reported. 👍

Copy link
Contributor Author

@0xsarvesh 0xsarvesh left a comment

Choose a reason for hiding this comment

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

@benjaminbollen and @schemar
I did suggested changes which also includes tests.
Please have a look to check if I haven't missed anything. 🙏

Copy link
Contributor

@schemar schemar left a comment

Choose a reason for hiding this comment

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

Nice! However, can we also add tests where verification should fail and assert that they still fail with the new code? I am not sure how much we want to test this, but from my point of view 2 tests seems a little slim.

Also minor in-line comments.

contracts/lib/MerklePatriciaProof.sol Outdated Show resolved Hide resolved
contracts/lib/MerklePatriciaProof.sol Outdated Show resolved Hide resolved
test/lib/merkle_patricia_proof.js Outdated Show resolved Hide resolved
Copy link
Contributor

@benjaminbollen benjaminbollen left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@schemar schemar left a comment

Choose a reason for hiding this comment

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

LGTM if we don't want to add more tests 👍

@benjaminbollen
Copy link
Contributor

I propose two paths:

  1. we can keep this hotfix on the branch, and over the coming days we put effort to adding more explicit unit tests
  2. we merge it with release-0.10, develop and publish beta.3 and we put effort to add more explicit unit tests 😝

@0xsarvesh
Copy link
Contributor Author

0xsarvesh commented Feb 20, 2019

Nice! However, can we also add tests where verification should fail and assert that they still fail with the new code? I am not sure how much we want to test this, but from my point of view 2 tests seems a little slim.

Also minor in-line comments.

@schemar These two tests are the scenarios where the bug was reported. It makes sense to add these tests that give confidence that the fix works.

However, what you are requesting is to test the MPP library in general, which I would say should be done as a separate ticket. Testing MPP library for all the scenarios is a significant effort, as we don't have proof for all the possible trie trees. These need to be manually formed(Unless there is a better alternative)

I am not sure if we want to do this for this fix.
@benjaminbollen what's your call?

@benjaminbollen
Copy link
Contributor

benjaminbollen commented Feb 20, 2019

@sarvesh-ost yes, I think this hotfix PR should go ahead so that we can test it, both in KIT and in JLP examples;

to @schemar s point, yes let's put focus on additional deliberate tests, but this is more work than this issue (echoing Sarvesh's point)

I propose we merge this into the hot fix branch; and go forward with publishing beta.3 so we can test it from KIT and JLP and increase coverage on develop

Copy link
Contributor

@schemar schemar left a comment

Choose a reason for hiding this comment

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

LGTM in light of #653

@schemar schemar merged commit 81d4e29 into OpenST:hotfix-0.10 Feb 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants