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

mark actions as PENDING while executing #1074

Merged
merged 1 commit into from
Jan 10, 2025
Merged

Conversation

dwerner
Copy link
Contributor

@dwerner dwerner commented Jan 9, 2025

This PR marks actions as PENDING while they are being executed. Out of this we can remove the dependency on a long-lived database transaction that can time out and fail while execution may have succeeded.

This attempts to address a couple of issues that have shown up lately:

  1. Contract execution fails sometimes, maybe due to estimateGas failing or if an allocation is already present for an action being executed (stale network state)
  2. A long-live database transaction has timed out, leading to issue 1. after the next execution of a batch.

The behavior I've opted for here is: success and failures during execution result in the same behavior as before, however if there is an exception during execution, (such as from interacting with graph-node or from the contracts), then the Action is returned to APPROVED state and will be processed again on the next execution batch.

One edge case this introduces is that if the process were to be interrupted while Actions are marked PENDING, then those will be left in that state. A warning is issued to the operator that these will need to be examined and cleared manually.

@dwerner dwerner requested a review from fordN January 9, 2025 19:19
@dwerner dwerner changed the title common: mark actions as PENDING while executing mark actions as PENDING while executing Jan 9, 2025
@dwerner dwerner force-pushed the action-execute-mark-pending branch from 9cdac0f to ac636ef Compare January 9, 2025 19:22
Copy link
Contributor

@fordN fordN left a comment

Choose a reason for hiding this comment

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

Looks good! Just one question about efficiency of updating statuses.

packages/indexer-common/src/indexer-management/actions.ts Outdated Show resolved Hide resolved
@dwerner dwerner force-pushed the action-execute-mark-pending branch from ac636ef to bcc74c6 Compare January 10, 2025 17:48
@fordN fordN added the enhancement New feature or request label Jan 10, 2025
@dwerner dwerner assigned fordN and unassigned dwerner Jan 10, 2025
Copy link
Contributor

@fordN fordN left a comment

Choose a reason for hiding this comment

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

👍

@dwerner dwerner merged commit 064eb5d into main Jan 10, 2025
8 checks passed
@dwerner dwerner deleted the action-execute-mark-pending branch January 10, 2025 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request indexer-agent
Projects
Status: 🚗 Merged
Development

Successfully merging this pull request may close these issues.

2 participants