From 66857e6ce1225ccf92c1def4e29106785f7783c0 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Wed, 27 Sep 2023 21:39:51 +0800 Subject: [PATCH] update plugin --- go.mod | 2 +- go.sum | 4 ++-- pkg/snapshot/service.go | 8 +------- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 17b13c1..a9d3b4e 100644 --- a/go.mod +++ b/go.mod @@ -127,7 +127,7 @@ require ( replace ( github.com/cerc-io/eth-iterator-utils => git.vdb.to/cerc-io/eth-iterator-utils v0.1.2 github.com/cerc-io/eth-testing => git.vdb.to/cerc-io/eth-testing v0.3.1 - github.com/cerc-io/plugeth-statediff => git.vdb.to/cerc-io/plugeth-statediff v0.1.3-0.20230926121233-367349b85a3c + github.com/cerc-io/plugeth-statediff => git.vdb.to/cerc-io/plugeth-statediff v0.1.3-0.20230927132920-c2ceca9230b2 github.com/ethereum/go-ethereum => git.vdb.to/cerc-io/plugeth v0.0.0-20230808125822-691dc334fab1 github.com/openrelayxyz/plugeth-utils => git.vdb.to/cerc-io/plugeth-utils v0.0.0-20230706160122-cd41de354c46 ) diff --git a/go.sum b/go.sum index 8ad8d72..cfc7eff 100644 --- a/go.sum +++ b/go.sum @@ -42,8 +42,8 @@ git.vdb.to/cerc-io/eth-testing v0.3.1 h1:sPnlMev6oEgTjsW7GtUkSsjKNG/+X6P9q0izSej git.vdb.to/cerc-io/eth-testing v0.3.1/go.mod h1:qdvpc/W1xvf2MKx3rMOqvFvYaYIHG77Z1g0lwsmw0Uk= git.vdb.to/cerc-io/plugeth v0.0.0-20230808125822-691dc334fab1 h1:KLjxHwp9Zp7xhECccmJS00RiL+VwTuUGLU7qeIctg8g= git.vdb.to/cerc-io/plugeth v0.0.0-20230808125822-691dc334fab1/go.mod h1:cYXZu70+6xmDgIgrTD81GPasv16piiAFJnKyAbwVPMU= -git.vdb.to/cerc-io/plugeth-statediff v0.1.3-0.20230926121233-367349b85a3c h1:PxMvSAzKSYm2hWE1+JNPZjGRTNQALJi6lna1m5C1j6Y= -git.vdb.to/cerc-io/plugeth-statediff v0.1.3-0.20230926121233-367349b85a3c/go.mod h1:PX1bwTwZKzegQu6zYdpuJf1tHNmU0suapKOUUO2xIzs= +git.vdb.to/cerc-io/plugeth-statediff v0.1.3-0.20230927132920-c2ceca9230b2 h1:ZQefRCEyA1tqTbz5TU852U4SVy5Blv+7TleasJ5G/Rc= +git.vdb.to/cerc-io/plugeth-statediff v0.1.3-0.20230927132920-c2ceca9230b2/go.mod h1:PX1bwTwZKzegQu6zYdpuJf1tHNmU0suapKOUUO2xIzs= git.vdb.to/cerc-io/plugeth-utils v0.0.0-20230706160122-cd41de354c46 h1:KYcbbne/RXd7AuxbUd/3hgk1jPN+33k2CKiNsUsMCC0= git.vdb.to/cerc-io/plugeth-utils v0.0.0-20230706160122-cd41de354c46/go.mod h1:VpDN61dxy64zGff05F0adujR5enD/JEdXBkTQ+PaIsQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= diff --git a/pkg/snapshot/service.go b/pkg/snapshot/service.go index e58fda5..a1658ce 100644 --- a/pkg/snapshot/service.go +++ b/pkg/snapshot/service.go @@ -132,19 +132,13 @@ func (s *Service) CreateSnapshot(params SnapshotParams) error { return s.indexer.PushIPLD(tx, c) } - // Build a diff against the zero hash (empty trie) to get a full snapshot - sdargs := statediff.Args{ - NewStateRoot: header.Root, - BlockHash: header.Hash(), - BlockNumber: header.Number, - } sdparams := statediff.Params{ WatchedAddresses: params.WatchedAddresses, } sdparams.ComputeWatchedAddressesLeafPaths() builder := statediff.NewBuilder(adapt.GethStateView(s.stateDB)) builder.SetSubtrieWorkers(params.Workers) - if err = builder.WriteStateDiffTracked(sdargs, sdparams, nodeSink, ipldSink, tr); err != nil { + if err = builder.WriteStateSnapshot(header.Root, sdparams, nodeSink, ipldSink, tr); err != nil { return err }