Skip to content

feat: add state-related tables#94

Open
weiihann wants to merge 18 commits intoethpandaops:masterfrom
weiihann:accounts
Open

feat: add state-related tables#94
weiihann wants to merge 18 commits intoethpandaops:masterfrom
weiihann:accounts

Conversation

@weiihann
Copy link
Contributor

@weiihann weiihann commented Oct 17, 2025

Description

1. Refactor the old tables

  • Filter on tx success for all existing tables
  • Fixes storage slot first and last access tables.
    • The previous implementation assumes that internal_index is uniform across the tables. However, internal_index only applies locally to its table, and does not represent the actual index of the operation executed in the transaction. Therefore, we cannot use internal_index to determine the ordering when joining the storage_reads and storage_diffs tables.
    • To mitigate this issue, storage_diffs will always overwrite the storage_reads if they have the same block_number.

2. Add new tables

  • int_address_diffs - the aggregation of nonce_diffs, balance_diffs, storage_diffs and contracts
  • int_address_reads - the aggregation of nonce_reads, balance_reads and storage_reads
  • int_pre_6780_accounts_destructs - selfdestructed accounts pre-EIP6780, which also includes the empty accounts created during the DoS attack.
  • int_post_6780_accounts_destructs - selfdestructed accounts post-EIP6780
  • int_accounts_alive - aggregation of int_address_diffs, int_pre_6780_accounts_destructs and int_post_6780_accounts_destructs.
  • int_address_slots_stat_per_block - storage slot stat per address per block
  • int_block_slots_stat - storage slot stat per block

3. Make the fact tables use the new changes

@weiihann weiihann requested a review from Savid as a code owner October 17, 2025 10:53
@weiihann
Copy link
Contributor Author

Technically int_address_first_access and int_address_last_access can backfill on int_address_diffs and int_address_reads but just to make sure the existing workflow isn't broken, I stick to the original one.

@weiihann weiihann marked this pull request as draft October 20, 2025 06:41
@weiihann
Copy link
Contributor Author

Converted to draft, will be adding on new changes

@weiihann weiihann marked this pull request as ready for review October 21, 2025 05:58
@weiihann weiihann changed the title feat: add new and modify old state expiry tables feat: add state-related tables Nov 10, 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