Skip to content

Conversation

@maximopalopoli
Copy link
Collaborator

@maximopalopoli maximopalopoli commented Dec 18, 2025

Description

This PR adds a retry logic with exponential backoff.

How to test

Normal workflow

  1. Start Ethereum Package:
make ethereum_package_start
  1. Start gateway and payments poller:
make agg_mode_gateway_start_local
make agg_mode_payments_poller_start_local
  1. Send funds and a sp1 proof:
make agg_mode_gateway_send_payment
make agg_mode_gateway_send_sp1_proof
  1. Aggregate the proof
make proof_aggregator_start_ethereum_package AGGREGATOR=sp1

Failure after retries

Do the same steps as before, but before step 4, go to the Docker container which maps the port 8545 (usually a el-X-geth-lighthouse) and shut it down.

Success after retries

The same as before, but when you see the first Started waiting until we can submit the aggregated proof. log, then start the container.

Type of change

Please delete options that are not relevant.

  • New feature
  • Bug fix
  • Optimization
  • Refactor

Checklist

  • “Hotfix” to testnet, everything else to staging
  • Linked to Github Issue
  • This change depends on code or research by an external entity
    • Acknowledgements were updated to give credit
  • Unit tests added
  • This change requires new documentation.
    • Documentation has been added/updated.
  • This change is an Optimization
    • Benchmarks added/run
  • Has a known issue
  • If your PR changes the Operator compatibility (Ex: Upgrade prover versions)
    • This PR adds compatibility for operator for both versions and do not change crates/docs/examples
    • This PR updates batcher and docs/examples to the newer version. This requires the operator are already updated to be compatible

@maximopalopoli maximopalopoli self-assigned this Dec 18, 2025
@maximopalopoli maximopalopoli marked this pull request as ready for review December 18, 2025 21:21

/// Supports retries only on async functions. See: https://docs.rs/backon/latest/backon/#retry-an-async-function
/// Runs with `jitter: false`.
pub async fn retry_function<FutureFn, Fut, T, E>(
Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't move this functions here. This file should only contain the abstraction to interact with backon or any retryable library, not business logic.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved back to the mod.rs file in 5a728d1

Comment on lines 316 to 317
#[cfg(test)]
mod tests {
Copy link
Member

Choose a reason for hiding this comment

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

If the should_send_proof_to_verify_on_chain is now in helpers it does not make much sense for them to be here. They should be moved to helpers.rs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done in e873b90


/// Supports retries only on async functions. See: https://docs.rs/backon/latest/backon/#retry-an-async-function
/// Runs with `jitter: false`.
pub async fn retry_function<FutureFn, Fut, T, E>(
Copy link
Member

Choose a reason for hiding this comment

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

I would remove bakon and write the backoff delay logic ourselves, it should be 10 lines of code. The usage of callbacks in bakon makes the code complex and hard to follow/read.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done in 352cce0

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.

3 participants