Skip to content
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

fix(cast): allow user to disable block gas limit check in cast run #9996

Merged
merged 2 commits into from
Mar 4, 2025

Conversation

minh-bq
Copy link
Contributor

@minh-bq minh-bq commented Mar 3, 2025

In Ronin (1) and BSC (2), there are system transactions which have gas limit higher than block gas limit. This commit adds --disable-block-gas-limit flag to cast run so that user can trace those transactions.

In Ronin[1] and BSC[2], there are system transactions which have gas limit higher
than block gas limit. This commit adds --disable-block-gas-limit flag to cast
run so that user can trace those transactions.

[1]: https://app.roninchain.com/tx/0x8323b1843da7e8c61be697b35885bf492f8ec30e4413aa32b629371733df60d7
[2]: https://bscscan.com/tx/0x2362c464510d39247b0718d661224c5b5d369e543a88eefb260c798dcda2624e
@zerosnacks
Copy link
Member

Hi @minh-bq thanks for your suggestion - would you mind adding a test case for this?

@minh-bq
Copy link
Contributor Author

minh-bq commented Mar 4, 2025

Hi, I've tried to add a test and it run just fine but the problem for ci is the rpc-url. As the system transaction trace requires archive endpoint and there are normally no public archive endpoint in Ronin or BSC (I used my own API key from Moralis provider for self test). So I am not sure how it's integrated into the project's ci.

diff --git a/crates/cast/tests/cli/main.rs b/crates/cast/tests/cli/main.rs
index bf83fc69f..64bc134cc 100644
--- a/crates/cast/tests/cli/main.rs
+++ b/crates/cast/tests/cli/main.rs
@@ -782,6 +782,28 @@
 "#]]);
 });
 
+// tests that `cast --disable-block-gas-limit` commands are working correctly
+// with Ronin's system transaction
+casttest!(run_disable_block_gas_limit_check, |_prj, cmd| {
+    let rpc = "redacted";
+    cmd.args([
+        "run",
+        "-v",
+        "0xf6d7ebc9861662caa571381dc518f25584d8fade3f7695cb70b5f7145e0ec0da",
+        "--quick",
+        "--rpc-url",
+        rpc,
+        "--disable-block-gas-limit",
+    ])
+    .assert_success()
+    .stdout_eq(str![[r#"
+...
+Transaction successfully executed.
+[GAS]
+
+"#]]);
+});
+

zerosnacks added a commit that referenced this pull request Mar 4, 2025
Copy link
Member

@zerosnacks zerosnacks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Manually confirmed this fix works as intended. Adding a follow-up test in #10004 for this that we can enable once we have BSC archive support.

@zerosnacks zerosnacks merged commit d1b1a25 into foundry-rs:master Mar 4, 2025
22 checks passed
@minh-bq minh-bq deleted the disable-block-gas-limit branch March 4, 2025 10:37
@zerosnacks zerosnacks added T-bug Type: bug C-cast Command: cast labels Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cast Command: cast T-bug Type: bug
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants