[WIP] Add additional test scenarios #14
Labels
No Label
bug
critical
duplicate
enhancement
epic
help wanted
in progress
invalid
low priority
question
rebase
v1
v5
wontfix
Copied from Github
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cerc-io/go-ethereum#14
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "add-additional-test-scenarios"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'm not sure how helpful this PR is in illustrating the questions/ideas that I was talking about during standup today. But basically what is happening is we have a test chain that is being created in https://github.com/vulcanize/go-ethereum/blob/statediffing/statediff/testhelpers/helpers.go. Three blocks, and the transactions on each block are:
Block 1:
test bank account
sendsaccount 1
10000 etherBlock 2:
test bank account
sendsaccount 1
1000 etheraccount 1
sendsaccount 2
1000 etheraccount 1
creates atest contract account
Block 3:
test bank account
changes the storage variabledata
's value at index 2 to 3account 2
mines the block, so gets the mining rewardtest
toTestContract
and then compiling it withpragma solidity ^0.5.0
- I'm not sure what the previous contract was compiled with.- contract account's state diff proof (the root hash and the leaf node hash)
- account 2's state diff proof (just the root hash)
- bank account's state diff proof ( just the root hash)
- burn account's state diff proof ( just the root hash)
- account 1's state diff proof (just the root hash)
- bank account state diff proof (just the root hash)
- contract account state diff proof (root hash and leaf node hash)
- account 2's state diff proof (just the root hash)
I guess my question is do these changes, specifically to the state diff proofs, make sense? I want to make sure that the I understand the changes I'm making the the tests before adding in some bigger changes to the test contract.
Hey @elizabethengelman thanks for the detailed breakdown!
Changing the contract name changes the byte code which changes the contract account's code hash, this is a change in a state trie node so that means that node hash is updated and the root for the entire state trie is updated. Differences in the the state trie roots will cause differences in the block hashes since the block hashes are the rlp encoding of the block headers which themselves include the state trie root. Since the state trie root has been changed every state proof- not just the contract account's proof- will be updated as well since the first byte array in each of the proof sets is the root hash itself. So for the contract account proof it makes sense to see a different root hash and a different leaf node hash and for the others to just see the different root hash- looks good to me!
@i-norden 🙏 thanks for taking a look & for that explanation - I was having trouble thinking it through at that level, so that is super helpful!
closing this in favor of https://github.com/vulcanize/go-ethereum/pull/15
Pull request closed