Skip to content

Commit

Permalink
[erigon2] print trie variant derived from trie instead switch log (er…
Browse files Browse the repository at this point in the history
…igontech#4672)

* [erigon2] print trie variant derived from trie instead switch log

* updated erigon-lib version

* bumped erigon-lib version
  • Loading branch information
awskii authored Jul 11, 2022
1 parent 51245d2 commit 9637b25
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions cmd/state/commands/erigon2.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,18 @@ func Erigon2(genesis *core.Genesis, chainConfig *params.ChainConfig, logger log.
var trieVariant commitment.TrieVariant
switch commitmentTrie {
case "bin":
logger.Info("using Binary Patricia Hashed Trie for commitments")
trieVariant = commitment.VariantBinPatriciaTrie
blockRootMismatchExpected = true
case "hex":
fallthrough
default:
logger.Info("using Hex Patricia Hashed Trie for commitments")
trieVariant = commitment.VariantHexPatriciaTrie
}

agg, err3 := aggregator.NewAggregator(aggPath, unwindLimit, aggregationStep, changesets, commitments, 100_000_000, commitment.InitializeTrie(trieVariant), rwTx)
trie := commitment.InitializeTrie(trieVariant)
logger.Info("commitment trie initialized", "variant", trie.Variant())

agg, err3 := aggregator.NewAggregator(aggPath, unwindLimit, aggregationStep, changesets, commitments, 100_000_000, trie, rwTx)
if err3 != nil {
return fmt.Errorf("create aggregator: %w", err3)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ require (
github.com/json-iterator/go v1.1.12
github.com/julienschmidt/httprouter v1.3.0
github.com/kevinburke/go-bindata v3.21.0+incompatible
github.com/ledgerwatch/erigon-lib v0.0.0-20220708142551-cf57648d7d41
github.com/ledgerwatch/erigon-lib v0.0.0-20220710110825-21c6baf2871c
github.com/ledgerwatch/log/v3 v3.4.1
github.com/ledgerwatch/secp256k1 v1.0.0
github.com/nxadm/tail v1.4.9-0.20211216163028-4472660a31a6
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758 h1:0D5M2HQSGD3PYPwICLl+/9oulQauOuETfgFvhBDffs0=
github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c=
github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8=
github.com/ledgerwatch/erigon-lib v0.0.0-20220708142551-cf57648d7d41 h1:sTY+hHzUSFWpUiw7bUqmw1opanXeSltDBPtOzbTQLFQ=
github.com/ledgerwatch/erigon-lib v0.0.0-20220708142551-cf57648d7d41/go.mod h1:bttvdtZXjh803u/CeMerKYnWvVvXTICWSfpcMeQNtmc=
github.com/ledgerwatch/erigon-lib v0.0.0-20220710110825-21c6baf2871c h1:xcHZhKSsUezVVGiqMxhe2qlkoedgkCAyx1Zi+bY9Pxs=
github.com/ledgerwatch/erigon-lib v0.0.0-20220710110825-21c6baf2871c/go.mod h1:bttvdtZXjh803u/CeMerKYnWvVvXTICWSfpcMeQNtmc=
github.com/ledgerwatch/log/v3 v3.4.1 h1:/xGwlVulXnsO9Uq+tzaExc8OWmXXHU0dnLalpbnY5Bc=
github.com/ledgerwatch/log/v3 v3.4.1/go.mod h1:VXcz6Ssn6XEeU92dCMc39/g1F0OYAjw1Mt+dGP5DjXY=
github.com/ledgerwatch/secp256k1 v1.0.0 h1:Usvz87YoTG0uePIV8woOof5cQnLXGYa162rFf3YnwaQ=
Expand Down

0 comments on commit 9637b25

Please sign in to comment.