-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TxLookup index per-txn-granularity #12424
Conversation
behooold (or just take a look) new table |
# Conflicts: # erigon-lib/go.mod # erigon-lib/go.sum
# Conflicts: # erigon-lib/go.mod # erigon-lib/go.sum # erigon-lib/gointerfaces/remoteproto/ethbackend.pb.go # erigon-lib/state/aggregator_test.go # eth/stagedsync/stage_txlookup.go # polygon/heimdall/entity_store_mock.go
@@ -106,38 +107,34 @@ func (g *Generator) addToCache(header *types.Header, receipts types.Receipts) { | |||
g.receiptsCache.Add(header.Hash(), receipts.Copy()) // .Copy() helps pprof to attribute memory to cache - instead of evm (where it was allocated). | |||
} | |||
|
|||
func (g *Generator) GetReceipt(ctx context.Context, cfg *chain.Config, tx kv.Tx, block *types.Block, index int, optimize bool) (*types.Receipt, error) { | |||
func (g *Generator) GetReceipt(ctx context.Context, cfg *chain.Config, tx kv.TemporalTx, block *types.Block, index int, txNum uint64) (*types.Receipt, error) { | |||
if receipts, ok := g.receiptsCache.Get(block.Hash()); ok && len(receipts) > index { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need one more cache for this method? (with txn granularity) - if yes, probably it's for another task
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think yes
closes #12366
closes #12343 (For test purposes)
closes #12892
Requires erigontech/interfaces#240
Also, I suppose it would require resync of chaindata