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: wrong gas parameters while broadcasting tx in script #473

Merged
merged 10 commits into from
Jul 16, 2024

Conversation

HermanObst
Copy link
Contributor

@HermanObst HermanObst commented Jul 12, 2024

Fix incorrect gas parameters while broadcasting txs in Script

Solution

We were using incorrect gas price for the fee estimations RPC call and also ignoring the gas_per_pubdata field for the EIP712 tx, defaulting to its max value, potentially leading to "not enough balance" issues

@HermanObst HermanObst changed the title fix broadcast gas fix gas in broadcast Jul 12, 2024
@HermanObst HermanObst changed the title fix gas in broadcast fix: gas in broadcast Jul 12, 2024
@HermanObst HermanObst changed the title fix: gas in broadcast fix: wrong gas parameters while broadcasting tx in script Jul 12, 2024
@@ -652,33 +651,38 @@ impl ScriptArgs {

let signed_tx = if let Some(zk) = zk {
let custom_data = Eip712Meta::new().factory_deps(zk.factory_deps);
let gas_price = provider.get_gas_price().await?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps get gas_price from tx or from provider if absent. In the end we use the one from the zks_estimateFee

@HermanObst HermanObst merged commit 825ca04 into dev Jul 16, 2024
11 checks passed
@HermanObst HermanObst deleted the herman/fix-broadcast-gas branch July 16, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants