Upgrade geth after schema changes (#97)
* Include intermediate nodes in builder tests for watched addresses * Upgrade geth
This commit is contained in:
parent
0c56037e1f
commit
1f898f60c3
2
go.mod
2
go.mod
@ -128,4 +128,4 @@ require (
|
|||||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
replace github.com/ethereum/go-ethereum v1.10.19 => github.com/vulcanize/go-ethereum v1.10.19-statediff-4.0.4-alpha
|
replace github.com/ethereum/go-ethereum v1.10.19 => github.com/vulcanize/go-ethereum v1.10.19-statediff-4.1.0-alpha
|
||||||
|
4
go.sum
4
go.sum
@ -727,8 +727,8 @@ github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPU
|
|||||||
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
|
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
|
||||||
github.com/vulcanize/go-eth-state-node-iterator v1.1.1 h1:/9zKsUzF1zlQDriAljdspmp1ixcIpOcbetiyHCPhbU0=
|
github.com/vulcanize/go-eth-state-node-iterator v1.1.1 h1:/9zKsUzF1zlQDriAljdspmp1ixcIpOcbetiyHCPhbU0=
|
||||||
github.com/vulcanize/go-eth-state-node-iterator v1.1.1/go.mod h1:pL9jDztI5Yv9OOCKpCyo08/v+27othmbQlggoqH84Zo=
|
github.com/vulcanize/go-eth-state-node-iterator v1.1.1/go.mod h1:pL9jDztI5Yv9OOCKpCyo08/v+27othmbQlggoqH84Zo=
|
||||||
github.com/vulcanize/go-ethereum v1.10.19-statediff-4.0.4-alpha h1:fcUztJhvVHytSMwFzjoVR1RIPDkuAoZG8uqQUb7wBMg=
|
github.com/vulcanize/go-ethereum v1.10.19-statediff-4.1.0-alpha h1:8ge2ban6t/e53XDwe6s28jcCevT7Ggo51lNJ0Eo1PgA=
|
||||||
github.com/vulcanize/go-ethereum v1.10.19-statediff-4.0.4-alpha/go.mod h1:5tMN+CDbK/qI2UlfN307HJykDmVIOCB1FM5RcHK9Kp8=
|
github.com/vulcanize/go-ethereum v1.10.19-statediff-4.1.0-alpha/go.mod h1:5tMN+CDbK/qI2UlfN307HJykDmVIOCB1FM5RcHK9Kp8=
|
||||||
github.com/vulcanize/leveldb-ethdb-rpc v0.1.3 h1:R0+2GNMQKPXsKVWjTc6h5khD/aZzSarxxVsPEtBHiHU=
|
github.com/vulcanize/leveldb-ethdb-rpc v0.1.3 h1:R0+2GNMQKPXsKVWjTc6h5khD/aZzSarxxVsPEtBHiHU=
|
||||||
github.com/vulcanize/leveldb-ethdb-rpc v0.1.3/go.mod h1:A3aI/tDglAHGpB9/vmtwS/mWOvfGl1UFJ1jCbhIPMAM=
|
github.com/vulcanize/leveldb-ethdb-rpc v0.1.3/go.mod h1:A3aI/tDglAHGpB9/vmtwS/mWOvfGl1UFJ1jCbhIPMAM=
|
||||||
github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc h1:9lDbC6Rz4bwmou+oE6Dt4Cb2BGMur5eR/GYptkKUVHo=
|
github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc h1:9lDbC6Rz4bwmou+oE6Dt4Cb2BGMur5eR/GYptkKUVHo=
|
||||||
|
@ -115,7 +115,6 @@ func (sdb *builder) WriteStateDiffObject(args sdtypes.StateRoots, params sd.Para
|
|||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
var err error
|
var err error
|
||||||
if !params.IntermediateStateNodes {
|
if !params.IntermediateStateNodes {
|
||||||
// if we are watching only specific accounts then we are only diffing leaf nodes
|
|
||||||
err = sdb.BuildStateDiffWithoutIntermediateStateNodes(iterPairs[worker], params, nodeSender, codeSender)
|
err = sdb.BuildStateDiffWithoutIntermediateStateNodes(iterPairs[worker], params, nodeSender, codeSender)
|
||||||
} else {
|
} else {
|
||||||
err = sdb.BuildStateDiffWithIntermediateStateNodes(iterPairs[worker], params, nodeSender, codeSender)
|
err = sdb.BuildStateDiffWithIntermediateStateNodes(iterPairs[worker], params, nodeSender, codeSender)
|
||||||
|
@ -999,6 +999,8 @@ func TestBuilderWithWatchedAddressList(t *testing.T) {
|
|||||||
block2 = blocks[1]
|
block2 = blocks[1]
|
||||||
block3 = blocks[2]
|
block3 = blocks[2]
|
||||||
params := sd.Params{
|
params := sd.Params{
|
||||||
|
IntermediateStateNodes: true,
|
||||||
|
IntermediateStorageNodes: true,
|
||||||
WatchedAddresses: []common.Address{test_helpers.Account1Addr, test_helpers.ContractAddr},
|
WatchedAddresses: []common.Address{test_helpers.Account1Addr, test_helpers.ContractAddr},
|
||||||
}
|
}
|
||||||
params.ComputeWatchedAddressesLeafPaths()
|
params.ComputeWatchedAddressesLeafPaths()
|
||||||
@ -1050,6 +1052,12 @@ func TestBuilderWithWatchedAddressList(t *testing.T) {
|
|||||||
BlockNumber: block1.Number(),
|
BlockNumber: block1.Number(),
|
||||||
BlockHash: block1.Hash(),
|
BlockHash: block1.Hash(),
|
||||||
Nodes: []sdtypes.StateNode{
|
Nodes: []sdtypes.StateNode{
|
||||||
|
{
|
||||||
|
Path: []byte{},
|
||||||
|
NodeType: sdtypes.Branch,
|
||||||
|
NodeValue: block1BranchRootNode,
|
||||||
|
StorageNodes: emptyStorage,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Path: []byte{'\x0e'},
|
Path: []byte{'\x0e'},
|
||||||
NodeType: sdtypes.Leaf,
|
NodeType: sdtypes.Leaf,
|
||||||
@ -1074,12 +1082,23 @@ func TestBuilderWithWatchedAddressList(t *testing.T) {
|
|||||||
BlockNumber: block2.Number(),
|
BlockNumber: block2.Number(),
|
||||||
BlockHash: block2.Hash(),
|
BlockHash: block2.Hash(),
|
||||||
Nodes: []sdtypes.StateNode{
|
Nodes: []sdtypes.StateNode{
|
||||||
|
{
|
||||||
|
Path: []byte{},
|
||||||
|
NodeType: sdtypes.Branch,
|
||||||
|
NodeValue: block2BranchRootNode,
|
||||||
|
StorageNodes: emptyStorage,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Path: []byte{'\x06'},
|
Path: []byte{'\x06'},
|
||||||
NodeType: sdtypes.Leaf,
|
NodeType: sdtypes.Leaf,
|
||||||
LeafKey: contractLeafKey,
|
LeafKey: contractLeafKey,
|
||||||
NodeValue: contractAccountAtBlock2LeafNode,
|
NodeValue: contractAccountAtBlock2LeafNode,
|
||||||
StorageNodes: []sdtypes.StorageNode{
|
StorageNodes: []sdtypes.StorageNode{
|
||||||
|
{
|
||||||
|
Path: []byte{},
|
||||||
|
NodeType: sdtypes.Branch,
|
||||||
|
NodeValue: block2StorageBranchRootNode,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Path: []byte{'\x02'},
|
Path: []byte{'\x02'},
|
||||||
NodeType: sdtypes.Leaf,
|
NodeType: sdtypes.Leaf,
|
||||||
@ -1124,12 +1143,23 @@ func TestBuilderWithWatchedAddressList(t *testing.T) {
|
|||||||
BlockNumber: block3.Number(),
|
BlockNumber: block3.Number(),
|
||||||
BlockHash: block3.Hash(),
|
BlockHash: block3.Hash(),
|
||||||
Nodes: []sdtypes.StateNode{
|
Nodes: []sdtypes.StateNode{
|
||||||
|
{
|
||||||
|
Path: []byte{},
|
||||||
|
NodeType: sdtypes.Branch,
|
||||||
|
NodeValue: block3BranchRootNode,
|
||||||
|
StorageNodes: emptyStorage,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Path: []byte{'\x06'},
|
Path: []byte{'\x06'},
|
||||||
NodeType: sdtypes.Leaf,
|
NodeType: sdtypes.Leaf,
|
||||||
LeafKey: contractLeafKey,
|
LeafKey: contractLeafKey,
|
||||||
NodeValue: contractAccountAtBlock3LeafNode,
|
NodeValue: contractAccountAtBlock3LeafNode,
|
||||||
StorageNodes: []sdtypes.StorageNode{
|
StorageNodes: []sdtypes.StorageNode{
|
||||||
|
{
|
||||||
|
Path: []byte{},
|
||||||
|
NodeType: sdtypes.Branch,
|
||||||
|
NodeValue: block3StorageBranchRootNode,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Path: []byte{'\x0c'},
|
Path: []byte{'\x0c'},
|
||||||
NodeType: sdtypes.Leaf,
|
NodeType: sdtypes.Leaf,
|
||||||
@ -1611,6 +1641,8 @@ func TestBuilderWithRemovedNonWatchedAccount(t *testing.T) {
|
|||||||
block5 = blocks[4]
|
block5 = blocks[4]
|
||||||
block6 = blocks[5]
|
block6 = blocks[5]
|
||||||
params := sd.Params{
|
params := sd.Params{
|
||||||
|
IntermediateStateNodes: true,
|
||||||
|
IntermediateStorageNodes: true,
|
||||||
WatchedAddresses: []common.Address{test_helpers.Account1Addr, test_helpers.Account2Addr},
|
WatchedAddresses: []common.Address{test_helpers.Account1Addr, test_helpers.Account2Addr},
|
||||||
}
|
}
|
||||||
params.ComputeWatchedAddressesLeafPaths()
|
params.ComputeWatchedAddressesLeafPaths()
|
||||||
@ -1632,6 +1664,12 @@ func TestBuilderWithRemovedNonWatchedAccount(t *testing.T) {
|
|||||||
BlockNumber: block4.Number(),
|
BlockNumber: block4.Number(),
|
||||||
BlockHash: block4.Hash(),
|
BlockHash: block4.Hash(),
|
||||||
Nodes: []sdtypes.StateNode{
|
Nodes: []sdtypes.StateNode{
|
||||||
|
{
|
||||||
|
Path: []byte{},
|
||||||
|
NodeType: sdtypes.Branch,
|
||||||
|
NodeValue: block4BranchRootNode,
|
||||||
|
StorageNodes: emptyStorage,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Path: []byte{'\x0c'},
|
Path: []byte{'\x0c'},
|
||||||
NodeType: sdtypes.Leaf,
|
NodeType: sdtypes.Leaf,
|
||||||
@ -1654,6 +1692,12 @@ func TestBuilderWithRemovedNonWatchedAccount(t *testing.T) {
|
|||||||
BlockNumber: block5.Number(),
|
BlockNumber: block5.Number(),
|
||||||
BlockHash: block5.Hash(),
|
BlockHash: block5.Hash(),
|
||||||
Nodes: []sdtypes.StateNode{
|
Nodes: []sdtypes.StateNode{
|
||||||
|
{
|
||||||
|
Path: []byte{},
|
||||||
|
NodeType: sdtypes.Branch,
|
||||||
|
NodeValue: block5BranchRootNode,
|
||||||
|
StorageNodes: emptyStorage,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Path: []byte{'\x0e'},
|
Path: []byte{'\x0e'},
|
||||||
NodeType: sdtypes.Leaf,
|
NodeType: sdtypes.Leaf,
|
||||||
@ -1676,6 +1720,12 @@ func TestBuilderWithRemovedNonWatchedAccount(t *testing.T) {
|
|||||||
BlockNumber: block6.Number(),
|
BlockNumber: block6.Number(),
|
||||||
BlockHash: block6.Hash(),
|
BlockHash: block6.Hash(),
|
||||||
Nodes: []sdtypes.StateNode{
|
Nodes: []sdtypes.StateNode{
|
||||||
|
{
|
||||||
|
Path: []byte{},
|
||||||
|
NodeType: sdtypes.Branch,
|
||||||
|
NodeValue: block6BranchRootNode,
|
||||||
|
StorageNodes: emptyStorage,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Path: []byte{'\x0c'},
|
Path: []byte{'\x0c'},
|
||||||
NodeType: sdtypes.Leaf,
|
NodeType: sdtypes.Leaf,
|
||||||
@ -1729,6 +1779,8 @@ func TestBuilderWithRemovedWatchedAccount(t *testing.T) {
|
|||||||
block5 = blocks[4]
|
block5 = blocks[4]
|
||||||
block6 = blocks[5]
|
block6 = blocks[5]
|
||||||
params := sd.Params{
|
params := sd.Params{
|
||||||
|
IntermediateStateNodes: true,
|
||||||
|
IntermediateStorageNodes: true,
|
||||||
WatchedAddresses: []common.Address{test_helpers.Account1Addr, test_helpers.ContractAddr},
|
WatchedAddresses: []common.Address{test_helpers.Account1Addr, test_helpers.ContractAddr},
|
||||||
}
|
}
|
||||||
params.ComputeWatchedAddressesLeafPaths()
|
params.ComputeWatchedAddressesLeafPaths()
|
||||||
@ -1750,12 +1802,23 @@ func TestBuilderWithRemovedWatchedAccount(t *testing.T) {
|
|||||||
BlockNumber: block4.Number(),
|
BlockNumber: block4.Number(),
|
||||||
BlockHash: block4.Hash(),
|
BlockHash: block4.Hash(),
|
||||||
Nodes: []sdtypes.StateNode{
|
Nodes: []sdtypes.StateNode{
|
||||||
|
{
|
||||||
|
Path: []byte{},
|
||||||
|
NodeType: sdtypes.Branch,
|
||||||
|
NodeValue: block4BranchRootNode,
|
||||||
|
StorageNodes: emptyStorage,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Path: []byte{'\x06'},
|
Path: []byte{'\x06'},
|
||||||
NodeType: sdtypes.Leaf,
|
NodeType: sdtypes.Leaf,
|
||||||
LeafKey: contractLeafKey,
|
LeafKey: contractLeafKey,
|
||||||
NodeValue: contractAccountAtBlock4LeafNode,
|
NodeValue: contractAccountAtBlock4LeafNode,
|
||||||
StorageNodes: []sdtypes.StorageNode{
|
StorageNodes: []sdtypes.StorageNode{
|
||||||
|
{
|
||||||
|
Path: []byte{},
|
||||||
|
NodeType: sdtypes.Branch,
|
||||||
|
NodeValue: block4StorageBranchRootNode,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Path: []byte{'\x04'},
|
Path: []byte{'\x04'},
|
||||||
NodeType: sdtypes.Leaf,
|
NodeType: sdtypes.Leaf,
|
||||||
@ -1791,12 +1854,23 @@ func TestBuilderWithRemovedWatchedAccount(t *testing.T) {
|
|||||||
BlockNumber: block5.Number(),
|
BlockNumber: block5.Number(),
|
||||||
BlockHash: block5.Hash(),
|
BlockHash: block5.Hash(),
|
||||||
Nodes: []sdtypes.StateNode{
|
Nodes: []sdtypes.StateNode{
|
||||||
|
{
|
||||||
|
Path: []byte{},
|
||||||
|
NodeType: sdtypes.Branch,
|
||||||
|
NodeValue: block5BranchRootNode,
|
||||||
|
StorageNodes: emptyStorage,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Path: []byte{'\x06'},
|
Path: []byte{'\x06'},
|
||||||
NodeType: sdtypes.Leaf,
|
NodeType: sdtypes.Leaf,
|
||||||
LeafKey: contractLeafKey,
|
LeafKey: contractLeafKey,
|
||||||
NodeValue: contractAccountAtBlock5LeafNode,
|
NodeValue: contractAccountAtBlock5LeafNode,
|
||||||
StorageNodes: []sdtypes.StorageNode{
|
StorageNodes: []sdtypes.StorageNode{
|
||||||
|
{
|
||||||
|
Path: []byte{},
|
||||||
|
NodeType: sdtypes.Branch,
|
||||||
|
NodeValue: block5StorageBranchRootNode,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Path: []byte{'\x0c'},
|
Path: []byte{'\x0c'},
|
||||||
NodeType: sdtypes.Leaf,
|
NodeType: sdtypes.Leaf,
|
||||||
@ -1833,12 +1907,23 @@ func TestBuilderWithRemovedWatchedAccount(t *testing.T) {
|
|||||||
BlockNumber: block6.Number(),
|
BlockNumber: block6.Number(),
|
||||||
BlockHash: block6.Hash(),
|
BlockHash: block6.Hash(),
|
||||||
Nodes: []sdtypes.StateNode{
|
Nodes: []sdtypes.StateNode{
|
||||||
|
{
|
||||||
|
Path: []byte{},
|
||||||
|
NodeType: sdtypes.Branch,
|
||||||
|
NodeValue: block6BranchRootNode,
|
||||||
|
StorageNodes: emptyStorage,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Path: []byte{'\x06'},
|
Path: []byte{'\x06'},
|
||||||
NodeType: sdtypes.Removed,
|
NodeType: sdtypes.Removed,
|
||||||
LeafKey: contractLeafKey,
|
LeafKey: contractLeafKey,
|
||||||
NodeValue: []byte{},
|
NodeValue: []byte{},
|
||||||
StorageNodes: []sdtypes.StorageNode{
|
StorageNodes: []sdtypes.StorageNode{
|
||||||
|
{
|
||||||
|
Path: []byte{},
|
||||||
|
NodeType: sdtypes.Removed,
|
||||||
|
NodeValue: []byte{},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Path: []byte{'\x02'},
|
Path: []byte{'\x02'},
|
||||||
NodeType: sdtypes.Removed,
|
NodeType: sdtypes.Removed,
|
||||||
|
@ -195,7 +195,7 @@ func (sds *Service) StateDiffAt(blockNumber uint64, params sd.Params) (*sd.Paylo
|
|||||||
}
|
}
|
||||||
logrus.Infof("sending state diff at block %d", blockNumber)
|
logrus.Infof("sending state diff at block %d", blockNumber)
|
||||||
|
|
||||||
// compute leaf keys of watched addresses in the params
|
// compute leaf paths of watched addresses in the params
|
||||||
params.ComputeWatchedAddressesLeafPaths()
|
params.ComputeWatchedAddressesLeafPaths()
|
||||||
|
|
||||||
if blockNumber == 0 {
|
if blockNumber == 0 {
|
||||||
@ -217,7 +217,7 @@ func (sds *Service) StateDiffFor(blockHash common.Hash, params sd.Params) (*sd.P
|
|||||||
}
|
}
|
||||||
logrus.Infof("sending state diff at block %s", blockHash.Hex())
|
logrus.Infof("sending state diff at block %s", blockHash.Hex())
|
||||||
|
|
||||||
// compute leaf keys of watched addresses in the params
|
// compute leaf paths of watched addresses in the params
|
||||||
params.ComputeWatchedAddressesLeafPaths()
|
params.ComputeWatchedAddressesLeafPaths()
|
||||||
|
|
||||||
if currentBlock.NumberU64() == 0 {
|
if currentBlock.NumberU64() == 0 {
|
||||||
@ -290,7 +290,7 @@ func (sds *Service) StateTrieAt(blockNumber uint64, params sd.Params) (*sd.Paylo
|
|||||||
}
|
}
|
||||||
logrus.Infof("sending state trie at block %d", blockNumber)
|
logrus.Infof("sending state trie at block %d", blockNumber)
|
||||||
|
|
||||||
// compute leaf keys of watched addresses in the params
|
// compute leaf paths of watched addresses in the params
|
||||||
params.ComputeWatchedAddressesLeafPaths()
|
params.ComputeWatchedAddressesLeafPaths()
|
||||||
|
|
||||||
return sds.processStateTrie(currentBlock, params)
|
return sds.processStateTrie(currentBlock, params)
|
||||||
@ -333,7 +333,7 @@ func (sds *Service) WriteStateDiffAt(blockNumber uint64, params sd.Params) error
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// compute leaf keys of watched addresses in the params
|
// compute leaf paths of watched addresses in the params
|
||||||
params.ComputeWatchedAddressesLeafPaths()
|
params.ComputeWatchedAddressesLeafPaths()
|
||||||
|
|
||||||
parentRoot := common.Hash{}
|
parentRoot := common.Hash{}
|
||||||
@ -358,7 +358,7 @@ func (sds *Service) WriteStateDiffFor(blockHash common.Hash, params sd.Params) e
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// compute leaf keys of watched addresses in the params
|
// compute leaf paths of watched addresses in the params
|
||||||
params.ComputeWatchedAddressesLeafPaths()
|
params.ComputeWatchedAddressesLeafPaths()
|
||||||
|
|
||||||
parentRoot := common.Hash{}
|
parentRoot := common.Hash{}
|
||||||
|
Loading…
Reference in New Issue
Block a user