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

Draft: backfill analyzer to re-parse all runtime events for evm_log_* fields #632

Closed
wants to merge 3 commits into from

Conversation

Andrew7234
Copy link
Collaborator

@Andrew7234 Andrew7234 commented Feb 9, 2024

do not merge

Context: A bug in the abi_analyzer accidentally overwrote the evm_log_* fields for some evm.log runtime events. This PR adapts the abi analyzer to re-parse all runtime evm.log events and correctly update the evm_log_* fields.

Also, the existing analyzer did not properly insert null values for evm_log_name and evm_log_signature. This analyzer inserts null values correctly.

The bulk of ParseEvent is a stripped down version of the existing event parsing code in extract.go

Testing:
I ran the analyzer on sapphire for ~500 blocks. I took a snapshot of the database, and then ran the modified abi analyzer on both sapphire til completion. I took a second snapshot of the database and compared it. The ordering of the rows was off, but most of the other data remained the same. The only different fields were the corrected null fields and abi_parsed_at as expected

Comment on lines +480 to +482
evm_log_name = $5,
evm_log_params = $6,
evm_log_signature = $7,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we definitely want to overwrite the old values here

@Andrew7234
Copy link
Collaborator Author

Applied to staging; events were reparsed successfully. No longer needed

@Andrew7234 Andrew7234 closed this Feb 15, 2024
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.

1 participant