-
Notifications
You must be signed in to change notification settings - Fork 193
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
feat(katana-messaging): remove sending messages to settlement layer #3035
base: main
Are you sure you want to change the base?
Conversation
Ohayo, sensei! Here are the updated details for this pull request: WalkthroughThis pull request refactors the messaging subsystem. The changes remove the Changes
Sequence Diagram(s)sequenceDiagram
participant MT as Messaging Task
participant MS as Messaging Service
participant SO as StarknetOS
participant SC as Settlement Chain
MT->>MS: Gather messages from settlement chain
MS->>SO: Execute proof generation (STARK proof)
SO-->>MS: Return generated proof
MS->>SC: Send proof for verification
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
crates/katana/messaging/src/service.rs (1)
105-109
: Ohayo sensei! There's a small nitpick on naming.
The field is spelledlastest_block
, but you might wantlatest_block
to avoid confusion.- pub lastest_block: u64, + pub latest_block: u64,crates/katana/messaging/src/starknet.rs (2)
98-98
: Consider improving error handling.Ohayo sensei! While the error handling change from
SendError
toGatherError
aligns with the removal of sending functionality, consider adding more context to help with debugging:- return Err(Error::GatherError); + return Err(Error::GatherError.with_context("Failed to fetch settlement chain block number"));
118-118
: Consider adding error context.Similar to above, consider adding more context to the error:
- .map_err(|_| Error::GatherError) + .map_err(|e| Error::GatherError.with_context(format!("Failed to fetch events: {}", e)))
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
📒 Files selected for processing (7)
crates/katana/messaging/Cargo.toml
(0 hunks)crates/katana/messaging/src/ethereum.rs
(1 hunks)crates/katana/messaging/src/lib.rs
(4 hunks)crates/katana/messaging/src/service.rs
(4 hunks)crates/katana/messaging/src/starknet.rs
(4 hunks)crates/katana/rpc/rpc/tests/messaging.rs
(1 hunks)crates/katana/sync/stage/src/sequencing.rs
(1 hunks)
💤 Files with no reviewable changes (1)
- crates/katana/messaging/Cargo.toml
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: ensure-windows
- GitHub Check: test
🔇 Additional comments (19)
crates/katana/messaging/src/service.rs (6)
20-20
: Ohayo sensei! Nice simplification by dropping the generic parameter.
This makes theMessagingService
more straightforward and aligns well with the removal of direct message sending.
33-33
: Ohayo sensei!
No concerns here—removing the generic bounds fromimpl MessagingService
keeps the code maintainable.
53-53
: Ohayo sensei!
Initializingmsg_gather_fut
asNone
is an elegant way to defer gathering until needed. Good job.
112-112
: Ohayo sensei!
Good usage ofStream
here. This improves clarity by consistently polling for new messaging outcomes.
118-124
: Ohayo sensei! Consider verifying the interval scheduling.
If gathering takes longer than the interval, ensure we don’t queue extra futures. This code is likely fine, but keep an eye on possible repeated scheduling.
133-133
: Ohayo sensei!
ReturningPoll::Ready(Some(MessagingOutcome { ... }))
is a neat approach to publish the new block’s outcome. Nicely handled.crates/katana/messaging/src/lib.rs (10)
5-8
: Ohayo sensei!
These doc lines clearly reflect the new focus on message gathering and proof-based sending. Good clarity.
11-11
: Ohayo sensei!
Mentioning Anvil usage is helpful for local dev context. Thumbs up!
18-21
: Ohayo sensei!
Great job highlighting the collecting of messages and proof generation steps. This clarifies how messages reach the settlement chain.
25-27
: Ohayo sensei!
Thanks for documenting theto_address
limitation. This warns devs to use an applicative workaround.
29-31
: Ohayo sensei!
Again, good doc about carrying the real address inpayload
. This offers a straightforward approach to circumventBlockifier
constraints.
100-101
: Ohayo sensei!
Documenting the interval with thorough comments is beneficial. No issues here.
122-122
: Ohayo sensei!
Specifically pullingrpc_url
andcore_contract
from the chain spec ensures consistency with settlement-layer config. Nice synergy.Also applies to: 131-131
211-212
: Ohayo sensei!
MakingMessagingTask
more concise without generics is consistent with the refactoring. Looks good.
215-216
: Ohayo sensei!
A simple constructor with only the needed parameter is a good step towards clarity.
228-235
: Ohayo sensei!
Nice logging approach. Conditionally logging message collection is helpful for debugging and verifying flows.crates/katana/sync/stage/src/sequencing.rs (1)
44-44
: Ohayo sensei!
Using the updatedMessagingService::new
signature with fewer parameters is neat and aligns with the new design.crates/katana/messaging/src/ethereum.rs (1)
21-21
: LGTM! Simplified imports.Ohayo! The import cleanup looks good, removing unused
warn
while keeping necessary logging levels.crates/katana/rpc/rpc/tests/messaging.rs (1)
67-73
: LGTM! Configuration simplified.Ohayo sensei! The
MessagingConfig
has been correctly simplified by removing the unusedsender_address
andprivate_key
fields, aligning with the removal of settlement layer messaging functionality.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3035 +/- ##
==========================================
- Coverage 56.31% 56.21% -0.10%
==========================================
Files 437 437
Lines 59013 58757 -256
==========================================
- Hits 33232 33031 -201
+ Misses 25781 25726 -55 ☔ View full report in Codecov by Sentry. |
//! execute them, and send messages to a settlement chain via a provable mechanism (STARK proof in | ||
//! the case of Starknet). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
STARK proof in the case of Starknet
I'd imagine it's same case as well when settling to Ethereum - that the messages would be settled by the proof (or to be exact, on the call to updateState
function on the settlement contract, no?
// Send message from L2 to L1 testing must be done using Saya or part of | ||
// it to ensure the settlement contract is test on piltover and its `update_state` method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We definitely need katana
<> saya
e2e tests.
I know, to some extent, parts of the settlement process can be already be mocked. But we should think how we can make the whole katana
to saya
flow in a way where each part can be easily mocked for testing purposes.
The feature of sending message to settlement layer was done mainly to test messaging in the early days of Starknet.
Now that app chains are here, there is no need of such feature.
This PR aims at removing all the code related to send a message to the settlement layout from Katana operated as a Rollup sequencer. Module documentation has been updated and types simplified when possible.
We also had some errors of type
Send
where it should have beenGather
, confusing me during some tests on Katana. Those errors have been fixed toGather
instead.In the current setup, we still have the blockifier limitation for the
to_address
field as mentioned in comment into the messaging crate doc. But this can be resolved by a simple application logic with theMSG_MAGIC
as it was implemented in Katana before trimming this code.Ideally @kariy as we have discussed, if the blockifier changes to remove this constraint aren't big, it will be beneficial to have
to_address
of typefelt
.Summary by CodeRabbit
MessagingService
andStarknetMessaging
structures by removing unnecessary fields and methods.