-
Notifications
You must be signed in to change notification settings - Fork 36
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
Revamp and Add More to Stylus Cache Manager CLI #78
Conversation
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.
Looks good! Just minor comments.
println!(""); | ||
let note = format!( | ||
r#"NOTE: We recommend running cargo stylus cache bid 0 {} to cache your activated contract in ArbOS. | ||
Cached contracts benefit from cheaper calls. To read more about the Stylus contract cache, see | ||
https://docs.arbitrum.io/stylus/concepts/stylus-cache-manager"#, | ||
hex::encode(contract_addr), | ||
).debug_mint(); | ||
println!("{note}"); |
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.
This notice format didn't work well. It is printing \n
instead of actual new lines. Also, the address and bid arguments are inverted here.
"NOTE: We recommend running cargo stylus cache bid 0 611696c1cff8c63f4b3c5308300d355dc80c4b65 to cache your activated contract in ArbOS.\nCached contracts benefit from cheaper calls. To read more about the Stylus contract cache, see\nhttps://docs.arbitrum.io/stylus/concepts/stylus-cache-manager"
} | ||
|
||
fn format_gas(gas: u128) -> String { | ||
let gas: u128 = gas.try_into().unwrap_or(u128::MAX); |
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.
The linter pointed out that this line could be removed, and it made sense. Maybe in the future we should block PRs from being merged if we get linter warnings.
Co-authored-by: Gabriel de Quadros Ligneul <[email protected]>
Description
This PR addresses all recent feedback on cache manager commands for cargo stylus. It includes the following:
cargo stylus cache bid [ADDRESS] [AMOUNT]
with documentationcargo stylus cache suggest-bid [ADDRESS]
, which gives the required bid for an address of a Stylus contractcargo stylus status --address=...
which provides a status update on the cache, including information about whether or not a specified address is cached and other data from the cache managerThis PR also uses alloy in the entire
cache
package instead of ethers-rs in an attempt to unify the cargo stylus repo to stick with alloy for Ethereum tooling