[PLEX-2731] - Cre forwarder#87
Open
ilija42 wants to merge 19 commits into
Open
Conversation
Soroban Contract Test Coverage93.21% line coverage — 18033 / 19347 lines hit
Per-Contract Breakdown
Full file-level coverage report |
Integration Test Coverage (excl. Token Pool) |
Integration Test Coverage (Token Pool) |
|
Code coverage report:
|
There was a problem hiding this comment.
Pull request overview
Adds a new Soroban smart contract crate (contracts/cre) implementing a “KeystoneForwarder” with ownership, forwarder registry, config management, signature verification, receiver dispatch, and transmission tracking for CRE report forwarding.
Changes:
- Introduces the KeystoneForwarder contract, storage schema, and event types.
- Adds an extensive Rust test suite covering initialization, config lifecycle, signature validation, replay rules, and receiver behavior.
- Registers the new crate in the workspace (and lockfile) and adds a local Makefile for build/test.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| contracts/cre/src/lib.rs | Core contract implementation: ownership/initialization guards, config + forwarder registry, report validation + signature verification, receiver dispatch + transmission tracking |
| contracts/cre/src/types.rs | Contract storage/data model types (config, transmissions, storage keys, state enums) |
| contracts/cre/src/events.rs | Contract event definitions for forwarder/config/report processing |
| contracts/cre/src/test.rs | Comprehensive end-to-end and negative-path tests, plus crypto/test fixtures and mock receivers |
| contracts/cre/Cargo.toml | New crate manifest and dependencies/dev-dependencies |
| contracts/cre/Makefile | Local build/test/fmt targets for the new contract crate |
| Cargo.toml | Adds contracts/cre to the workspace members |
| Cargo.lock | Adds lock entries for the new crate and dev-deps |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+578
to
+583
| fn receiver_contract_id_bytes(env: &Env, receiver: &Address) -> Bytes { | ||
| match receiver.to_payload() { | ||
| Some(AddressPayload::ContractIdHash(hash)) => Bytes::from(hash), | ||
| _ => panic_with_error!(env, Error::InvalidReceiver), | ||
| } | ||
| } |
Comment on lines
+163
to
+172
| if f == 0 { | ||
| panic_with_error!(&env, Error::FaultToleranceMustBePositive); | ||
| } | ||
| if signers.len() > MAX_ORACLES { | ||
| panic_with_error!(&env, Error::ExcessSigners); | ||
| } | ||
| // BFT bound: need ≥ 3f + 1 signers configured to tolerate f faulty. | ||
| if signers.len() < f * 3 + 1 { | ||
| panic_with_error!(&env, Error::InsufficientSigners); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.