feat(ethexe): Producer provides only promises hashes, instead of its full body #5132
feat(ethexe): Producer provides only promises hashes, instead of its full body #5132ecol-master wants to merge 70 commits intomasterfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the handling of promises by the producer to send compact, signed promise hashes instead of the full promise body, which is a good optimization for network bandwidth. The changes are spread across multiple crates, introducing PromisesNetworkBundle and CompactSignedPromise and updating the database, consensus, and network layers to support this new flow.
However, the implementation appears to be incomplete and contains several critical issues that must be addressed:
- The verification logic for promise bundles in
ethexe/network/src/validator/topic.rsis commented out, which poses a significant security risk. - The associated tests for this verification are also disabled.
- The RPC API implementation in
ethexe/rpc/src/apis/injected.rscontains multipletodo!placeholders for crucial logic and error handling.
These issues suggest the feature is not ready for merging. I've left specific comments on these points. Additionally, I've suggested a minor performance improvement in ethexe/compute/src/compute.rs.
77cdb86 to
a1e405c
Compare
grishasobol
left a comment
There was a problem hiding this comment.
LGTM , but please wait for @ark0f approve
Delta ReviewThis round fixes all three issues from the previous review and adds gossipsub metrics registration, a Previous Issues
New Findings
|
|
/review-delta |
Delta ReviewThis round fixes the subscriber leak from the previous review and adds: (1) auto-routing of transactions with a zero recipient to the calculated next-slot producer, and (2) persisting Previous Issues
New Findings
|
…//github.com/gear-tech/gear into kuzmindev/feat/producer-send-promises-hashes
|
@claude review |
|
Claude finished @ecol-master's task in 4m 6s —— View job PR ReviewThis PR changes the ethexe producer from gossiping full Previous issues from earlier review rounds are all resolved. New findings below. severity: high — File: #[ignore = "TODO"]
#[tokio::test]
async fn verify_promise_ok() {This is the only test exercising the happy-path compact-promise verification flow. The implementation of severity: medium — File: type PromisesComputationWaiting = Arc<DashMap<HashOf<InjectedTransaction>, CompactSignedPromise>>;A validator with a valid signing key can insert an arbitrary number of compact promises for nonexistent severity: medium — routing failures are silent in production logs File: let next_producer = calculate_next_producer(db, now).map_err(|err| {
trace!("calculate next producer error: {err}");
crate::errors::internal()
})?;This was flagged in the previous delta review and remains unchanged. Routing failures (e.g. era validators not yet in DB, system clock errors) are logged at severity: low — File: The previous implementation emitted severity: low — File: /// Returns the promise by its transaction hash.
fn promise(&self, hash: HashOf<InjectedTransaction>) -> Option<Promise>;
fn compact_promise(&self, hash: HashOf<InjectedTransaction>) -> Option<CompactSignedPromise>;
Previously Fixed Issues
|
…//github.com/gear-tech/gear into kuzmindev/feat/producer-send-promises-hashes
|
This pull request is reopened in #5377 |
No description provided.