Skip to content
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

Merged
merged 76 commits into from
Dec 11, 2024
Merged

TxLookup index per-txn-granularity #12424

merged 76 commits into from
Dec 11, 2024

Conversation

JkLondon
Copy link
Member

@JkLondon JkLondon commented Oct 23, 2024

closes #12366
closes #12343 (For test purposes)
closes #12892

Requires erigontech/interfaces#240

Also, I suppose it would require resync of chaindata

@JkLondon
Copy link
Member Author

behooold (or just take a look) new table

# Conflicts:
#	erigon-lib/go.mod
#	erigon-lib/go.sum
@JkLondon JkLondon changed the title [wip] Txnum index [wip] Txnum index DON'T MERGE Oct 24, 2024
@JkLondon JkLondon self-assigned this Oct 24, 2024
JkLondon added 4 commits October 25, 2024 11:43
# Conflicts:
#	turbo/jsonrpc/receipts/receipts_generator.go
@AskAlexSharov AskAlexSharov changed the title [wip] Txnum index DON'T MERGE [wip] TxLookup index per-txn-granularity DON'T MERGE Nov 1, 2024
AskAlexSharov and others added 9 commits November 1, 2024 14:30
# 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
@JkLondon JkLondon changed the title [wip] TxLookup index per-txn-granularity DON'T MERGE TxLookup index per-txn-granularity Dec 10, 2024
@@ -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 {
Copy link
Collaborator

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think yes

@AskAlexSharov AskAlexSharov merged commit 8489566 into main Dec 11, 2024
13 checks passed
@AskAlexSharov AskAlexSharov deleted the txnum-index branch December 11, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants