Skip to content

Commit

Permalink
Updates gas limit and fixes masp tests
Browse files Browse the repository at this point in the history
  • Loading branch information
grarco committed Sep 12, 2024
1 parent 8897117 commit 8fa4a20
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion crates/sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub use {namada_io as io, namada_wallet as wallet};
use crate::masp::ShieldedContext;

/// Default gas-limit
pub const DEFAULT_GAS_LIMIT: u64 = 200_000;
pub const DEFAULT_GAS_LIMIT: u64 = 250_000;

#[cfg_attr(feature = "async-send", async_trait::async_trait)]
#[cfg_attr(not(feature = "async-send"), async_trait::async_trait(?Send))]
Expand Down
24 changes: 11 additions & 13 deletions crates/tests/src/integration/masp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ fn masp_incentives() -> Result<()> {
"--token",
NAM,
"--gas-limit",
"250000",
"300000",
"--amount",
"1.451732",
"--signing-keys",
Expand Down Expand Up @@ -2582,8 +2582,6 @@ fn masp_fee_payment() -> Result<()> {
NAM,
"--amount",
"10000",
"--gas-limit",
"200000",
"--gas-price",
"1",
"--disposable-gas-payer",
Expand Down Expand Up @@ -2617,7 +2615,7 @@ fn masp_fee_payment() -> Result<()> {
)
});
assert!(captured.result.is_ok());
assert!(captured.contains("nam: 290000"));
assert!(captured.contains("nam: 240000"));
let captured = CapturedOutput::of(|| {
run(
&node,
Expand Down Expand Up @@ -2750,7 +2748,7 @@ fn masp_fee_payment_gas_limit() -> Result<()> {
"--amount",
"1",
"--gas-limit",
"300000",
"500000",
"--gas-price",
"1",
"--disposable-gas-payer",
Expand Down Expand Up @@ -2920,7 +2918,7 @@ fn masp_fee_payment_with_non_disposable() -> Result<()> {
"--amount",
"1",
"--gas-limit",
"200000",
"300000",
"--gas-price",
"1",
"--gas-payer",
Expand Down Expand Up @@ -2959,7 +2957,7 @@ fn masp_fee_payment_with_non_disposable() -> Result<()> {
)
});
assert!(captured.result.is_ok());
assert!(captured.contains("nam: 1799999"));
assert!(captured.contains("nam: 1699999"));

let captured = CapturedOutput::of(|| {
run(
Expand Down Expand Up @@ -3067,7 +3065,7 @@ fn masp_fee_payment_with_custom_spending_key() -> Result<()> {
"--token",
NAM,
"--amount",
"250000",
"300000",
"--ledger-address",
validator_one_rpc,
],
Expand Down Expand Up @@ -3117,7 +3115,7 @@ fn masp_fee_payment_with_custom_spending_key() -> Result<()> {
)
});
assert!(captured.result.is_ok());
assert!(captured.contains("nam: 250000"));
assert!(captured.contains("nam: 300000"));

// Masp fee payment with custom gas payer
let captured = CapturedOutput::of(|| {
Expand All @@ -3135,7 +3133,7 @@ fn masp_fee_payment_with_custom_spending_key() -> Result<()> {
"--amount",
"9000",
"--gas-limit",
"250000",
"300000",
"--gas-price",
"1",
"--gas-spending-key",
Expand Down Expand Up @@ -3314,7 +3312,7 @@ fn masp_fee_payment_with_different_token() -> Result<()> {
"--token",
BTC,
"--amount",
"250000",
"300000",
"--gas-payer",
ALBERT_KEY,
"--ledger-address",
Expand Down Expand Up @@ -3383,7 +3381,7 @@ fn masp_fee_payment_with_different_token() -> Result<()> {
)
});
assert!(captured.result.is_ok());
assert!(captured.contains("btc: 250000"));
assert!(captured.contains("btc: 300000"));

// Masp fee payment with custom token and gas payer
let captured = CapturedOutput::of(|| {
Expand All @@ -3403,7 +3401,7 @@ fn masp_fee_payment_with_different_token() -> Result<()> {
"--gas-token",
BTC,
"--gas-limit",
"250000",
"300000",
"--gas-price",
"1",
"--gas-spending-key",
Expand Down
4 changes: 2 additions & 2 deletions genesis/hardware/parameters.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ epochs_per_year = 31_536_000
# The multiplier for masp epochs
masp_epoch_multiplier = 2
# Max gas for block
max_block_gas = 20_000_000
max_block_gas = 25_000_000
# Masp fee payment gas limit
masp_fee_payment_gas_limit = 200_000
masp_fee_payment_gas_limit = 250_000
# Gas scale
gas_scale = 10_000

Expand Down
4 changes: 2 additions & 2 deletions genesis/localnet/parameters.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ epochs_per_year = 31_536_000
# The multiplier for masp epochs
masp_epoch_multiplier = 2
# Max gas for block
max_block_gas = 20_000_000
max_block_gas = 25_000_000
# Masp fee payment gas limit
masp_fee_payment_gas_limit = 200_000
masp_fee_payment_gas_limit = 250_000
# Gas scale
gas_scale = 10_000

Expand Down
4 changes: 2 additions & 2 deletions genesis/starter/parameters.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ epochs_per_year = 31_536_000
# The multiplier for masp epochs
masp_epoch_multiplier = 2
# Max gas for block
max_block_gas = 20_000_000
max_block_gas = 25_000_000
# Masp fee payment gas limit
masp_fee_payment_gas_limit = 200_000
masp_fee_payment_gas_limit = 250_000
# Gas scale
gas_scale = 10_000

Expand Down

0 comments on commit 8fa4a20

Please sign in to comment.