feat(agglayer): add CLAIM note cycle count benchmark#2618
feat(agglayer): add CLAIM note cycle count benchmark#2618partylikeits1983 wants to merge 4 commits intoagglayerfrom
Conversation
Nice! So, we should definitely set the max for network note execution above 32K cycles. Maybe 64K cycles? cc @Mirko-von-Leipzig (not sure what it is set at currently). Also, how difficult is it to add an actual benchmark? (i.e., similar to what we have for P2ID notes) |
|
We don't explicitly configure the executor, so we get the default values for expected and max cycles. afaict this is set to pub const MAX_CYCLES: u32 = 1 << 29; |
I think it would be easy, will update to be more of a true benchmark. |
Ah - let's create an issue in the node to add such a cap (unless we have such an issue already). |
mmagician
left a comment
There was a problem hiding this comment.
While on it, could we further add benchmarks for B2AGG note?
|
|
||
| /// Bridge asset test vectors JSON — contains test data for an L1 bridgeAsset transaction. | ||
| const BRIDGE_ASSET_VECTORS_JSON: &str = include_str!( | ||
| "../../../crates/miden-agglayer/solidity-compat/test-vectors/claim_asset_vectors_local_tx.json" |
There was a problem hiding this comment.
this path looks a bit fragile.
The alternative would be to move the test vector generation here (build script?) which I think is even worse 😁
other ideas welcome
| #[derive(Debug, Deserialize)] | ||
| struct LeafValueVector { | ||
| origin_network: u32, | ||
| origin_token_address: String, | ||
| #[allow(dead_code)] | ||
| destination_network: u32, | ||
| destination_address: String, | ||
| #[serde(deserialize_with = "deserialize_uint_to_string")] | ||
| amount: String, | ||
| metadata_hash: String, | ||
| } |
There was a problem hiding this comment.
could we not re-use this from the testing crate? looks like a lot of duplicated code
This PR adds an assertion to the
CLAIMnote tests which asserts that the cycle count for consuming a CLAIM note should be less than 40k cycles.Currently the CLAIM note takes ~25662 cycles for L1 to Miden bridging, and ~38547 cycles for L2 to Miden bridging.
Resolves #2590