chore: retry activate on crisp server#1171
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughAdded a crate-root re-export of Changes
Sequence Diagram(s)sequenceDiagram
participant Server as Server (CRISP indexer)
participant Helper as evm_helpers::send_tx_with_retry
participant Node as Blockchain Provider
Server->>Helper: send_tx_with_retry("activate", args, async closure)
Note right of Helper: closure sends transaction (calls provider)
Helper->>Node: send_transaction(payload)
alt transient error
Node-->>Helper: transient error
Helper->>Helper: backoff & retry (retry_with_backoff)
Helper->>Node: send_transaction(payload) (retry)
end
Node-->>Helper: TransactionReceipt
Helper-->>Server: TransactionReceipt or final error
Server->>Server: log result / map errors to eyre
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@examples/CRISP/server/src/server/token_holders/etherscan.rs`:
- Around line 449-453: Guard against underflow when computing
U256::from(block_number - 1) before calling token.getPastVotes: check
block_number and use a saturating decrement (e.g., compute let query_block = if
block_number == 0 { 0 } else { block_number - 1 }; or use
block_number.saturating_sub(1)) and then convert query_block to U256, and pass
that U256 to token.getPastVotes(voter_address, U256::from(query_block)). Ensure
this logic is applied where token.getPastVotes, voter_address, and block_number
are used so you never call getPastVotes with a wrapped/negative value.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
examples/CRISP/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (8)
crates/evm/src/lib.rsexamples/CRISP/Cargo.tomlexamples/CRISP/server/Cargo.tomlexamples/CRISP/server/src/server/indexer.rsexamples/CRISP/server/src/server/repo.rsexamples/CRISP/server/src/server/routes/rounds.rsexamples/CRISP/server/src/server/routes/state.rsexamples/CRISP/server/src/server/token_holders/etherscan.rs
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 145
File: packages/ciphernode/evm/src/enclave_sol_reader.rs:87-89
Timestamp: 2024-10-22T03:39:29.448Z
Learning: In the `ciphernode` project, specifically in `packages/ciphernode/evm/src/enclave_sol_reader.rs`, the method `EnclaveSolReader::attach` should be retained even if it directly calls `EvmEventReader::attach` without additional processing. Avoid suggesting its removal in future reviews.
Learnt from: ctrlc03
Repo: gnosisguild/enclave PR: 657
File: Cargo.toml:32-34
Timestamp: 2025-08-25T10:28:56.174Z
Learning: The examples/CRISP directory has its own Cargo.toml workspace configuration with members like "server", "wasm-crypto", "program/core", "program/client", etc. The root workspace intentionally excludes "examples/CRISP/server", "examples/CRISP/program", and "examples/CRISP/wasm-crypto" to prevent double workspace membership, which is the correct approach for self-contained example workspaces.
📚 Learning: 2024-10-22T03:39:29.448Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 145
File: packages/ciphernode/evm/src/enclave_sol_reader.rs:87-89
Timestamp: 2024-10-22T03:39:29.448Z
Learning: In the `ciphernode` project, specifically in `packages/ciphernode/evm/src/enclave_sol_reader.rs`, the method `EnclaveSolReader::attach` should be retained even if it directly calls `EvmEventReader::attach` without additional processing. Avoid suggesting its removal in future reviews.
Applied to files:
crates/evm/src/lib.rs
📚 Learning: 2024-09-26T03:11:29.311Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 107
File: packages/ciphernode/sortition/src/distance.rs:1-1
Timestamp: 2024-09-26T03:11:29.311Z
Learning: In `packages/ciphernode/core/src/events.rs`, the import statements use the correct and updated `alloy::primitives` module.
Applied to files:
crates/evm/src/lib.rsexamples/CRISP/server/src/server/routes/rounds.rsexamples/CRISP/server/src/server/routes/state.rsexamples/CRISP/server/src/server/token_holders/etherscan.rs
📚 Learning: 2024-11-05T06:56:49.157Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 173
File: packages/ciphernode/enclave_node/src/aggregator.rs:0-0
Timestamp: 2024-11-05T06:56:49.157Z
Learning: `RegistryFilterSol` does not have a reader and does not require a repository reader or deploy block when calling `RegistryFilterSol::attach` in `packages/ciphernode/enclave_node/src/aggregator.rs`.
Applied to files:
crates/evm/src/lib.rs
📚 Learning: 2024-10-16T09:51:10.038Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 145
File: packages/ciphernode/router/src/committee_meta.rs:43-43
Timestamp: 2024-10-16T09:51:10.038Z
Learning: In `packages/ciphernode/router/src/committee_meta.rs`, avoid suggesting making the `on_event` method in `CommitteMetaFeature` asynchronous or adding error handling for the `write` operation to the data store.
Applied to files:
examples/CRISP/server/src/server/indexer.rs
📚 Learning: 2024-10-08T07:15:06.690Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 139
File: packages/ciphernode/evm/src/ciphernode_registry_sol.rs:133-143
Timestamp: 2024-10-08T07:15:06.690Z
Learning: In `packages/ciphernode/evm/src/ciphernode_registry_sol.rs`, the function `helpers::stream_from_evm` in Rust returns `()`, not a `Result`, so error handling with `if let Err(e) = ...` is not applicable.
Applied to files:
examples/CRISP/server/src/server/indexer.rs
📚 Learning: 2024-11-05T06:48:58.177Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 173
File: packages/ciphernode/config/src/app_config.rs:13-21
Timestamp: 2024-11-05T06:48:58.177Z
Learning: In the `packages/ciphernode/config/src/app_config.rs` file, for the `Contract` enum, the team prefers to use `String` type for `address` fields, relying on parsing to handle validation, instead of using the `Address` type.
Applied to files:
examples/CRISP/server/src/server/routes/state.rs
📚 Learning: 2025-08-25T10:28:56.174Z
Learnt from: ctrlc03
Repo: gnosisguild/enclave PR: 657
File: Cargo.toml:32-34
Timestamp: 2025-08-25T10:28:56.174Z
Learning: The examples/CRISP directory has its own Cargo.toml workspace configuration with members like "server", "wasm-crypto", "program/core", "program/client", etc. The root workspace intentionally excludes "examples/CRISP/server", "examples/CRISP/program", and "examples/CRISP/wasm-crypto" to prevent double workspace membership, which is the correct approach for self-contained example workspaces.
Applied to files:
examples/CRISP/server/Cargo.tomlexamples/CRISP/Cargo.toml
📚 Learning: 2024-10-22T02:36:01.448Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 145
File: packages/ciphernode/data/Cargo.toml:0-0
Timestamp: 2024-10-22T02:36:01.448Z
Learning: In `packages/ciphernode/data/Cargo.toml`, `actix-rt` is only used in tests and should remain in `[dev-dependencies]`.
Applied to files:
examples/CRISP/server/Cargo.tomlexamples/CRISP/Cargo.toml
🧬 Code graph analysis (3)
crates/evm/src/lib.rs (1)
crates/evm/src/helpers.rs (1)
send_tx_with_retry(240-278)
examples/CRISP/server/src/server/indexer.rs (1)
crates/evm/src/helpers.rs (1)
send_tx_with_retry(240-278)
examples/CRISP/server/src/server/routes/state.rs (1)
examples/CRISP/server/src/server/repo.rs (2)
store(38-40)store(116-118)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: rust_integration
- GitHub Check: build_crisp_sdk
- GitHub Check: test_net
- GitHub Check: build_ciphernode_image
- GitHub Check: build_sdk
- GitHub Check: rust_unit
- GitHub Check: build_enclave_cli
- GitHub Check: build_e3_support_dev
- GitHub Check: integration_prebuild
- GitHub Check: Build & Push Image
🔇 Additional comments (9)
crates/evm/src/lib.rs (1)
25-25: Clean crate-root re-export.
This makes the helper easier to consume without exposing internal module paths.examples/CRISP/server/Cargo.toml (1)
48-48: Workspace dependency addition looks good.examples/CRISP/server/src/server/routes/rounds.rs (1)
10-12: Formatting-only change; behavior unchanged.Also applies to: 88-91
examples/CRISP/server/src/server/token_holders/etherscan.rs (1)
7-13: Import reorg is clear and consistent.examples/CRISP/server/src/server/indexer.rs (1)
19-19: Retry wrapper integration is clean and readable.Also applies to: 379-392
examples/CRISP/server/src/server/repo.rs (1)
47-57: Formatting-only adjustments look good.
No functional changes detected in these edits.Also applies to: 60-64, 186-186
examples/CRISP/server/src/server/routes/state.rs (2)
9-18: Import reflow is clean and consistent.
No behavior change here.
225-228: Signature formatting is fine.
No functional impact from the generic syntax cleanup.examples/CRISP/Cargo.toml (1)
42-42: Local workspace dependency resolves correctly.
The crate at../../crates/evmexists and is properly namede3-evm, matching the dependency specification.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
5a632c1 to
b882822
Compare
Summary by CodeRabbit
New Features
Refactor
Chores
✏️ Tip: You can customize this high-level summary in your review settings.