From 6c129e5f1def998269c29b20a31a9d850b37a7d2 Mon Sep 17 00:00:00 2001 From: Alex Sharov Date: Tue, 6 Jun 2023 11:29:30 +0700 Subject: [PATCH] e3: agg generalize PutIdx method (#7671) --- core/state/rw_v3.go | 12 ++++++------ go.mod | 2 +- go.sum | 6 ++---- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/core/state/rw_v3.go b/core/state/rw_v3.go index e8841e3ff..ed70c78f5 100644 --- a/core/state/rw_v3.go +++ b/core/state/rw_v3.go @@ -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 } } } diff --git a/go.mod b/go.mod index 1f4c34379..051a7ae22 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 96c66f550..06bea152d 100644 --- a/go.sum +++ b/go.sum @@ -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=