Skip to content

StateCache: follow up #20333

Description

@AskAlexSharov
  1. commitment disabled:
// sc.caches[kv.CommitmentDomain] = NewDomainCache(commitmentBytes)

and Warmuper does race on Commitment on StateCache
when i enabled commitment domain on release/3.4 i got:

ERIGON_ASSERT=true go  test  -short -failfast -count=1 ./rpc/...
ok      github.com/erigontech/erigon/rpc        0.213s
?       github.com/erigontech/erigon/rpc/contracts      [no test files]
ok      github.com/erigontech/erigon/rpc/ethapi 0.058s
ok      github.com/erigontech/erigon/rpc/filters        0.005s
ok      github.com/erigontech/erigon/rpc/gasprice       0.066s
?       github.com/erigontech/erigon/rpc/gasprice/gaspricecfg   [no test files]
[WARN] [04-05|06:46:35.275] [env]                                    ERIGON_ASSERT=true
panic: assert: stateCache mismatch: domain=commitment key=00 cache=50015001121471562b71999873db5b286df957af199ec94617f7208923ec43f90694c4e06f7385cc25a820653f447a27dd66383c951c498cded9f712140d3ab14bbad3d99f4203bd7a11acb94882050e7e20102ea68f8c18cb6408e8d51de41a53eadc126d4681f7208d49a578374669de471214703c4b2bd70c169f5717101caee543299fc946c720df416f1cceace2dde579b7a56fedbe8b5fc9df4cea6aa936b8b9dd3c2c349287 truth= (inMem=false)

goroutine 23074 [running]:
github.com/erigontech/erigon/db/state/execctx.(*SharedDomains).GetLatest(0x1b2d6acdba40, 0x3, {0x384a4c8, 0x1b2d6aa7c400}, {0x1b2d6e0f4480, 0x1, 0x1})
        /home/erigon/erigon/db/state/execctx/domain_shared.go:415 +0x5bb
github.com/erigontech/erigon/db/state/execctx.(*temporalGetter).GetLatest(0x718b007bfad8?, 0xf0?, {0x1b2d6e0f4480?, 0x455b66?, 0x1b2d6a30aca0?})
        /home/erigon/erigon/db/state/execctx/domain_shared.go:230 +0x35
github.com/erigontech/erigon/execution/commitment/commitmentdb.(*LatestStateReader).Read(0x4bd4a5?, 0x3, {0x1b2d6e0f4480?, 0x11005ec?, 0x1b2d69461860?}, 0x1b2d6a30ad08?)
        /home/erigon/erigon/execution/commitment/commitmentdb/reader.go:38 +0x2a
github.com/erigontech/erigon/execution/commitment/commitmentdb.(*TrieContext).readDomain(...)
        /home/erigon/erigon/execution/commitment/commitmentdb/commitment_context.go:629
github.com/erigontech/erigon/execution/commitment/commitmentdb.(*TrieContext).Branch(0x2ad7c40?, {0x1b2d6e0f4480?, 0x1b2d6a30ad48?, 0xf6b3d6?})
        /home/erigon/erigon/execution/commitment/commitmentdb/commitment_context.go:603 +0x36
github.com/erigontech/erigon/execution/commitment.(*Warmuper).branchFromCacheOrDB(0x1b2d6aceb380, {0x3810920?, 0x1b2d68f4e320?}, {0x1b2d6e0f4480, 0x1, 0x1})
        /home/erigon/erigon/execution/commitment/warmuper.go:114 +0x9a
github.com/erigontech/erigon/execution/commitment.(*Warmuper).warmupKey(0x1b2d6aceb380, {0x3810920, 0x1b2d68f4e320}, {0x1b2d7167a054, 0x40, 0x1d4bac}, 0x0?)
        /home/erigon/erigon/execution/commitment/warmuper.go:200 +0xe5
github.com/erigontech/erigon/execution/commitment.(*Warmuper).Start.func1()
        /home/erigon/erigon/execution/commitment/warmuper.go:184 +0xb5
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /home/erigon/go/pkg/mod/golang.org/x/sync@v0.20.0/errgroup/errgroup.go:93 +0x50
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 23038
        /home/erigon/go/pkg/mod/golang.org/x/sync@v0.20.0/errgroup/errgroup.go:78 +0x95
FAIL    github.com/erigontech/erigon/rpc/jsonrpc        1.196s
?       github.com/erigontech/erigon/rpc/jsonrpc/contracts      [no test files]
ok      github.com/erigontech/erigon/rpc/jsonrpc/receipts       0.138s
ok      github.com/erigontech/erigon/rpc/jsonstream     0.003s
ok      github.com/erigontech/erigon/rpc/mcp    0.069s
ok      github.com/erigontech/erigon/rpc/mcp/metrics    0.005s
ok      github.com/erigontech/erigon/rpc/requests       0.056s
?       github.com/erigontech/erigon/rpc/rpccfg [no test files]
ok      github.com/erigontech/erigon/rpc/rpchelper      0.062s
?       github.com/erigontech/erigon/rpc/transactions   [no test files]
FAIL
  1. Need revive/re-test/merge: [SharovBot] revert: Revert PR #19508 (Revert "[wip] sd: removing txNum field") #19564

  2. There are several hacks for Commitment: if sd.stateCache != nil && domain != kv.CommitmentDomain {

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions