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

Vdb 833 more robust statediffing tests #15

Closed

Conversation

elizabethengelman
Copy link

@elizabethengelman elizabethengelman commented Sep 18, 2019

Updated the contract that's being used to test the statediffing work. The biggest change is that TestContract now has different data types in it's storage: bytes32, address, uint48, uint256[10], mapping(uint => TestStruct).

Note: I was having trouble calculating the TestStruct storage key earlier, but I think it was a silly mistake that I figured out, and it is now working. i.e. common.HexToHash(“3”) !=common.Hex2Bytes(“03”) != common.Hex2Bytes(“3”) 🤦‍♀

This should be ready for review finally! 😅

@elizabethengelman elizabethengelman force-pushed the VDB-833-more-robust-statediffing-tests branch 3 times, most recently from 0423e80 to 965dd84 Compare September 18, 2019 18:05
@elizabethengelman elizabethengelman changed the title Vdb 833 more robust statediffing tests [WIP] Vdb 833 more robust statediffing tests Sep 18, 2019
@elizabethengelman elizabethengelman force-pushed the VDB-833-more-robust-statediffing-tests branch from 965dd84 to f5cab3a Compare September 18, 2019 22:29
… types

Update test account variable names with block numbers
@elizabethengelman elizabethengelman changed the title [WIP] Vdb 833 more robust statediffing tests Vdb 833 more robust statediffing tests Sep 18, 2019
@elizabethengelman elizabethengelman force-pushed the VDB-833-more-robust-statediffing-tests branch from f5cab3a to f51d44d Compare September 18, 2019 22:54
Copy link
Collaborator

@i-norden i-norden left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for improving these tests :)

//slot 1: mapping(uint => TestStruct)
// calculate key for TestStruct.var1
testStructVar1Key = calculateTestStructStorageKey() // cc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f
keccakOfTestStructVar1Key = crypto.Keccak256Hash(testStructVar1Key.Bytes()) // the statediff service is currently emitting the key as a keccak hash
Copy link
Collaborator

@i-norden i-norden Sep 20, 2019

Choose a reason for hiding this comment

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

I see how the emitted keys are so confusing now, since calculateTestStructStorageKey already returns a hash/the key itself is already a hash.

i-norden added a commit that referenced this pull request Feb 2, 2020
@i-norden i-norden closed this Sep 8, 2020
i-norden pushed a commit that referenced this pull request Sep 14, 2020
* eth-sign: initial implementation

* sighash: pre-refactor

* sighash: refactor, all old tests pass

* sighash: test ovmsigner code paths for eip155 and eth_sign

* sighash: tx serialization tests

* sighash: refactor to sign bytes

* common/varbytes: use varbytes serialization from btcd

* transactionmeta: implement and test

* rawdb: add new index

* types/transaction: use txmeta

* blockchain: index tx meta on new block

* rpc: fix sendrawethsigntransaction docstring

* meta test: remove dead code

* ethapi: clean up comment

* lint: fix

* txmeta: clean up compares

* ethapi: remove rlp tag

* signer: remove rlp encoding tags from struct

* types: use factory pattern for getting sighash type

* sighash: migrate to using const

* tx pool: use ovmsigner for tx validation

* tx signing: fix eth_sign serialization

* sighash: new version

* sighash: commit to chainid

* sighash: bugfixes

* core/types: prevent panic on tx sort

* core/types: rename to transaction_meta

* core/blockchain: index txmeta

* sighash: no native value

* ethapi: use ovm signer

* sighash: move chainid
@AFDudley AFDudley deleted the VDB-833-more-robust-statediffing-tests branch September 30, 2020 13:24
i-norden pushed a commit that referenced this pull request Sep 9, 2022
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.

2 participants