Skip to content

Commit b488131

Browse files
conorschcratelyn
authored andcommitted
fix: add FeeTier support to galileo tx sending
During Testnet 77 we enabled fees [0] and in the process broke some things like Galileo. Adding FeeTier support is rather straightforward, although this changeset requires a patch to the `penumbra-fee` crate in order to compile [1]. [0] penumbra-zone/penumbra#4306 [1] penumbra-zone/penumbra#4539
1 parent c398e89 commit b488131

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ parallel = ["penumbra-wallet/parallel"]
1515
# Penumbra dependencies
1616
penumbra-proto = { path = "../penumbra/crates/proto", features = ["rpc", "box-grpc"] }
1717
penumbra-asset = { path = "../penumbra/crates/core/asset" }
18+
penumbra-fee = { path = "../penumbra/crates/core/component/fee" }
1819
penumbra-keys = { path = "../penumbra/crates/core/keys" }
1920
penumbra-custody = { path = "../penumbra/crates/custody" }
2021
penumbra-wallet = { path = "../penumbra/crates/wallet" }

src/opt/serve.rs

-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ use crate::{
2727

2828
#[derive(Debug, Clone, Parser)]
2929
pub struct Serve {
30-
/// The transaction fee for each response (paid in upenumbra).
31-
#[structopt(long, default_value = "0")]
32-
fee: u64,
3330
/// Per-user rate limit (e.g. "10m" or "1day").
3431
#[clap(short, long, default_value = "1day", parse(try_from_str = humantime::parse_duration))]
3532
rate_limit: Duration,

src/sender.rs

+14
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ use penumbra_proto::view::v1::broadcast_transaction_response::Status as Broadcas
1111

1212
use penumbra_asset::Value;
1313
use penumbra_custody::{AuthorizeRequest, CustodyClient};
14+
use penumbra_fee::FeeTier;
15+
use penumbra_fee::GasPrices;
1416
use penumbra_keys::{Address, FullViewingKey};
1517
use penumbra_txhash::TransactionId;
1618
use penumbra_view::ViewClient;
@@ -70,7 +72,19 @@ where
7072
"tried to send empty list of values to address"
7173
));
7274
}
75+
7376
let mut planner = Planner::new(OsRng);
77+
78+
// Here we hardcode low fees. It'd be nice to override via CLI arg.
79+
// Look up GasPrices, because merely calling `set_fee_tier` is not sufficient.
80+
let gp: GasPrices = self2
81+
.view
82+
.gas_prices()
83+
.await
84+
.expect("failed to look up GasPrices");
85+
planner.set_gas_prices(gp);
86+
planner.set_fee_tier(FeeTier::Low);
87+
7488
for value in values {
7589
planner.output(value, address.clone());
7690
}

0 commit comments

Comments
 (0)