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

[Access] Add util command to backfill tx error messages db #6525

Draft
wants to merge 67 commits into
base: master
Choose a base branch
from

Conversation

UlyanaAndrukhiv
Copy link
Contributor

@UlyanaAndrukhiv UlyanaAndrukhiv commented Oct 3, 2024

Closes: #6413

Note: #6468 and #6499 should be merged first.

Context

This pull request introduces a utility command that allows ANs to backfill missing transaction error messages from start to end height and a set of ENs to their local databases. This ensures that historical ANs have the necessary data to serve requests moving forward.

The command accepts a list of EN IDs (execution-node-ids) , if not provided, it defaults to query any available EN. It optionally takes a start and end block height (start-height, end-height); if not provided, it defaults to the root block and latest sealed block.

Before execution, the command checks if AN indexing is enabled. For each failed transaction within the block range, it retrieves and stores the error messages locally. It queries ENs in order and stops after the first successful response.

The command uses GetTransactionErrorMessagesByBlockID for optimized batch retrieval.

Unit tests are included to ensure functionality.

…BlockID, backend and ingestion engine, updated tests
@codecov-commenter
Copy link

codecov-commenter commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 56.43836% with 318 lines in your changes missing coverage. Please review.

Project coverage is 41.68%. Comparing base (3602aeb) to head (95d3849).

Files with missing lines Patch % Lines
storage/mock/transaction_result_error_messages.go 0.00% 86 Missing ⚠️
cmd/access/node_builder/access_node_builder.go 0.00% 68 Missing ⚠️
...e/common/rpc/execution_node_identities_provider.go 68.03% 29 Missing and 10 partials ⚠️
cmd/observer/node_builder/observer_builder.go 0.00% 32 Missing ⚠️
...min/commands/storage/backfill_tx_error_messages.go 76.69% 12 Missing and 12 partials ⚠️
engine/access/ingestion/engine.go 71.42% 15 Missing and 7 partials ⚠️
storage/badger/operation/transaction_results.go 0.00% 22 Missing ⚠️
...torage/badger/transaction_result_error_messages.go 81.48% 10 Missing and 10 partials ⚠️
engine/access/rpc/backend/node_selector.go 25.00% 3 Missing ⚠️
engine/access/rpc/backend/backend_transactions.go 98.50% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6525      +/-   ##
==========================================
+ Coverage   41.28%   41.68%   +0.40%     
==========================================
  Files        2031     2020      -11     
  Lines      145887   144607    -1280     
==========================================
+ Hits        60226    60278      +52     
+ Misses      79442    78083    -1359     
- Partials     6219     6246      +27     
Flag Coverage Δ
unittests 41.68% <56.43%> (+0.40%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

[Access] Add util command to backfill tx error messages db
2 participants