Skip to content

receipts RPC latency: persist recent receipts (optional flag)#14398

Merged
AskAlexSharov merged 3 commits into
mainfrom
receipt_store
Apr 10, 2025
Merged

receipts RPC latency: persist recent receipts (optional flag)#14398
AskAlexSharov merged 3 commits into
mainfrom
receipt_store

Conversation

@AskAlexSharov

@AskAlexSharov AskAlexSharov commented Apr 2, 2025

Copy link
Copy Markdown
Collaborator

To enable: --experiment.persist.receipts=10_000
Details:

  • Persistence: happening only on ChainTip and "lazy". Lazy - means it persist receipts of new executed blocks (amount will grow with time - up to a --experiment.persist.receipts=10_000 limit) and prune later
  • Stored in ChaindataDB - means no loss after at Erigon restart
  • Storing and canonical and non-canonical receipts (no deletes on unwind)
  • RPC and P2P requests are covered
  • Values: 1_000 good starting point. 10_000 receitps it's ~1Gb (not much IO increase). Please test on your setup if you want to go over 100_000

Idea: Decided to not subscribe RPCD to new Erigon's receipts. Persistence in db means:

  • new receipts available for readers immediately (on gap in async event delivery)
  • can afford to store "denormalized, and non-optimized" version of receipt - not like in E2 - because we do store not much receipts
  • receipts LRU doesn't need to cache receipts if we found it in DB. because DB it's already kind-of cache (small, mmaped, hot file). It means - receipts LRU will cover only old receipts - which has different access pattern from recent.

@AskAlexSharov AskAlexSharov changed the title [wip] receipt persistance: step1 [wip] recent receipts persistence: to reduce RPC latency Apr 10, 2025
Comment thread cmd/utils/flags.go Outdated
Comment thread core/rawdb/accessors_chain.go
@AskAlexSharov AskAlexSharov changed the title [wip] recent receipts persistence: to reduce RPC latency recent receipts persistence: to reduce RPC latency Apr 10, 2025
@AskAlexSharov AskAlexSharov merged commit c528cc2 into main Apr 10, 2025
@AskAlexSharov AskAlexSharov deleted the receipt_store branch April 10, 2025 10:52
@AskAlexSharov AskAlexSharov changed the title recent receipts persistence: to reduce RPC latency receipts RPC latency: persist recent receipts (optional flag) Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants