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

make evm_log_* fields null for non evm.log events #640

Merged
merged 2 commits into from
Feb 14, 2024

Conversation

Andrew7234
Copy link
Collaborator

@Andrew7234 Andrew7234 commented Feb 13, 2024

While cleaning up the evm_log_* fields in #632 I noticed that these fields weren't properly set to null. evm_log_name was set to the empty string and evm_log_signature was set to a zero bytestring.

Note: This PR does not include a migration to retroactively set existing fields to null. The queries to do this take on the order of 24hrs to run, which would be unacceptable downtime for any prod deployment. Instead, we should run the following queries manually

UPDATE chain.runtime_events
SET
	evm_log_name = NULL
WHERE
	evm_log_name = '';

UPDATE chain.runtime_events
SET
	evm_log_signature = NULL
WHERE
	evm_log_signature = decode('0000000000000000000000000000000000000000000000000000000000000000', 'hex');

Testing: Manually ran the indexer and confirmed that there were no rows where evm_log_* was non-null for any non evm.log events.

select * from chain.runtime_events where type != 'evm.log' and evm_log_signature is not null limit 10;

@Andrew7234 Andrew7234 force-pushed the andrew7234/fix-null-fields branch from fee6ded to cf5b9bf Compare February 13, 2024 04:33
Copy link
Contributor

@mitjat mitjat left a comment

Choose a reason for hiding this comment

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

nice 👍

@Andrew7234 Andrew7234 merged commit 92b9851 into main Feb 14, 2024
9 checks passed
@Andrew7234 Andrew7234 deleted the andrew7234/fix-null-fields branch February 14, 2024 13:37
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