e3: agg generalize PutIdx method (#7671)

This commit is contained in:
Alex Sharov 2023-06-06 11:29:30 +07:00 committed by GitHub
parent 3a8d5c4d0a
commit 6c129e5f1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 11 deletions

View File

@ -483,25 +483,25 @@ func (rs *StateV3) ApplyHistory(txTask *exec22.TxTask, agg *libstate.AggregatorV
}
if txTask.TraceFroms != nil {
for addr := range txTask.TraceFroms {
if err := agg.AddTraceFrom(addr[:]); err != nil {
if err := agg.PutIdx(kv.TracesFromIdx, addr[:]); err != nil {
return err
}
}
}
if txTask.TraceTos != nil {
for addr := range txTask.TraceTos {
if err := agg.AddTraceTo(addr[:]); err != nil {
if err := agg.PutIdx(kv.TracesToIdx, addr[:]); err != nil {
return err
}
}
}
for _, log := range txTask.Logs {
if err := agg.AddLogAddr(log.Address[:]); err != nil {
return fmt.Errorf("adding event log for addr %x: %w", log.Address, err)
if err := agg.PutIdx(kv.LogAddressIdx, log.Address[:]); err != nil {
return err
}
for _, topic := range log.Topics {
if err := agg.AddLogTopic(topic[:]); err != nil {
return fmt.Errorf("adding event log for topic %x: %w", topic, err)
if err := agg.PutIdx(kv.LogTopicIndex, topic[:]); err != nil {
return err
}
}
}

2
go.mod
View File

@ -3,7 +3,7 @@ module github.com/ledgerwatch/erigon
go 1.19
require (
github.com/ledgerwatch/erigon-lib v0.0.0-20230603101257-079c50c8e7e9
github.com/ledgerwatch/erigon-lib v0.0.0-20230606042724-1d950212cb96
github.com/ledgerwatch/erigon-snapshot v1.2.1-0.20230605042354-196538d42475
github.com/ledgerwatch/log/v3 v3.8.0
github.com/ledgerwatch/secp256k1 v1.0.0

6
go.sum
View File

@ -445,10 +445,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-20230603101257-079c50c8e7e9 h1:1rVUe0LKXOlxQBZWqukakqmEmhdmyT+OmPHb1EHLKh8=
github.com/ledgerwatch/erigon-lib v0.0.0-20230603101257-079c50c8e7e9/go.mod h1:FhbowXTrC1rT1Les246ls279E7EtF05T/3AWbKN3oI8=
github.com/ledgerwatch/erigon-snapshot v1.2.0 h1:Pf6eu5XqB29Mlg3oY9zxZ8qenSi2azgcwuNRDvV2rAM=
github.com/ledgerwatch/erigon-snapshot v1.2.0/go.mod h1:3AuPxZc85jkehh/HA9h8gabv5MSi3kb/ddtzBsTVJFo=
github.com/ledgerwatch/erigon-lib v0.0.0-20230606042724-1d950212cb96 h1:Hf1FI5VjqfBWymriS+xxhOAEVTEay13OozltajWP6Qk=
github.com/ledgerwatch/erigon-lib v0.0.0-20230606042724-1d950212cb96/go.mod h1:FhbowXTrC1rT1Les246ls279E7EtF05T/3AWbKN3oI8=
github.com/ledgerwatch/erigon-snapshot v1.2.1-0.20230605042354-196538d42475 h1:1BvWA6agTUS4RZUHx79f45HpvelMVv4iEddaURUYcC8=
github.com/ledgerwatch/erigon-snapshot v1.2.1-0.20230605042354-196538d42475/go.mod h1:3AuPxZc85jkehh/HA9h8gabv5MSi3kb/ddtzBsTVJFo=
github.com/ledgerwatch/log/v3 v3.8.0 h1:gCpp7uGtIerEz1jKVPeDnbIopFPud9ZnCpBLlLBGqPU=