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

Gas & Fee #1327

Merged
merged 54 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
130d304
Reworks `gas` module. Introduces `GasMetering` trait and gas sub-units
grarco Aug 21, 2023
b8dd0a1
Adds gas and fee protocol parameters
grarco Aug 21, 2023
0345e79
Adds `split_borrow` method to `WriteLogAndStorage` trait
grarco Aug 21, 2023
01d88a5
Adds a precommit write log to `WriteLog`. Adjusts gas accounting with…
grarco Aug 21, 2023
d030d33
Adds core methods for fee unshielding. Brings back `GasLimit` to `u64`
grarco Aug 21, 2023
18a1c82
Adds new CLI arguments for gas & fee
grarco Aug 21, 2023
f3a91be
Always expects a block proposer. Moves `WrapperTx` handling inside `d…
grarco Aug 21, 2023
7efbb23
Reviews `ErrorCodes`. Adds fee validation function
grarco Aug 21, 2023
309d13e
Updates unit tests for mandatory block proposer
grarco Aug 21, 2023
b0d4500
Renames `BlockAllocator` and makes it track gas too
grarco Aug 21, 2023
310b493
`prepare_proposal` validates gas & fee. Extracts validation to a sepa…
grarco Aug 21, 2023
c741770
`process_proposal` validates gas & fees
grarco Aug 21, 2023
72e1c62
Adds benchmarks crate for gas
grarco Aug 21, 2023
2ca6fbd
Whitelisted gas in wasm
grarco Aug 21, 2023
32ad862
Exposes wasm functions for consuming gas
grarco Aug 21, 2023
6b36b78
Renames gas function and adds exposed function for signatures' verifi…
grarco Aug 21, 2023
55e0c4c
Gas metering for sig verification
grarco Aug 21, 2023
b35fda0
Updates wasm vps with gas and host sig verification
grarco Aug 21, 2023
67ede24
Fixes `clean-wasm` step of wasm Makefile
grarco Aug 21, 2023
f2e3662
Removes masp fees + gas for the vp
grarco Aug 21, 2023
2401b2d
Updates gas computation with multipliers
grarco Aug 21, 2023
99d3ebf
Adds spare gas for each tx in the storage queue
grarco Aug 21, 2023
3c2fdec
`ShellParams` carries a generic wl_storage. Reworks `dispatch_tx` to …
grarco Aug 21, 2023
b40c6e7
Helper storage functions to construct fee unshielding tx in protocol
grarco Aug 21, 2023
9124ae4
Updates gas meter objects initializations
grarco Aug 21, 2023
5aa3a89
Dry-run wrapper tx
grarco Aug 21, 2023
300d670
Reworks wasm compilation step. Accepts `floats` wasm feature
grarco Aug 21, 2023
6942795
Renames `gas_payer` to `fee_payer`
grarco Aug 21, 2023
36074e2
Handles wrapper's signer separately
grarco Aug 21, 2023
c47b19d
Sdk functions to return the optional `Epoch` for fee unshielding
grarco Aug 21, 2023
1c89ca1
Adds disposable wrapper signer. Adjusts tx construction for fees
grarco Aug 21, 2023
435c95e
Misc adjustments for testing
grarco Aug 21, 2023
5b69afa
Updates e2e tests
grarco Aug 21, 2023
d21f801
Updates gas meters in tests
grarco Aug 21, 2023
2ce9523
Adds disposable signer e2e test. Updates other tests
grarco Aug 21, 2023
5c6a387
Adds fee unshielding integration test. Updates other tests
grarco Aug 21, 2023
a53eda6
Updates visibility of functions
grarco Aug 21, 2023
0c49f6a
Adds gas and fees protocol parameters to query response
grarco Aug 21, 2023
ffd6b60
Reduces the scale of the gas sub-units
grarco Aug 21, 2023
c19617c
Fixes `fee_amount` parsing
grarco Aug 21, 2023
a50c0c9
Refactors `get_tx_fee` to avoid using `Uint`
grarco Aug 21, 2023
7abb349
Renames fee payers cli arguments
grarco Aug 21, 2023
8910e0e
Fixes gas in tests
grarco Aug 21, 2023
3a941b0
Renames fees cli arguments
grarco Aug 22, 2023
604427c
Improves fee-related logs in the client
grarco Aug 22, 2023
047469b
Moves disposable signing key generation to wallet module
grarco Aug 22, 2023
1531ea6
Saves optional disposable keypair to wallet
grarco Aug 22, 2023
30d6bfa
Fixes broken fee optimization logic in cli. Fixes fee unshielding log…
grarco Aug 23, 2023
33418c7
Adds check on masp gas payer
grarco Aug 24, 2023
48a05a3
Changes `dev` feature to `testing`
grarco Aug 24, 2023
c4b28b8
Keep write log changes before fee unshield failure in `charge_fee`
grarco Aug 24, 2023
ecf2962
[ci] wasm checksums update
grarco Aug 21, 2023
af95690
changelog: #1327
grarco Aug 21, 2023
5b36a37
Removes unused or renamed files
grarco Sep 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changelog/unreleased/features/1327-variable-fees.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Implemented the runtime gas and fee system.
([\#1327](https://github.com/anoma/namada/pull/1327))
1 change: 1 addition & 0 deletions .github/workflows/scripts/e2e.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"e2e::ledger_tests::test_genesis_validators": 14,
"e2e::ledger_tests::test_node_connectivity_and_consensus": 28,
"e2e::ledger_tests::test_epoch_sleep": 12,
"e2e::ledger_tests::wrapper_disposable_signer": 28,
"e2e::wallet_tests::wallet_address_cmds": 1,
"e2e::wallet_tests::wallet_encrypted_key_cmds": 1,
"e2e::wallet_tests::wallet_encrypted_key_cmds_env_var": 1,
Expand Down
199 changes: 196 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resolver = "2"

members = [
"apps",
"benches",
"core",
"ethereum_bridge",
"proof_of_stake",
Expand Down
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ crates += namada_vm_env
crates += namada_vp_prelude

build:
$(cargo) build $(jobs)
$(cargo) build $(jobs) --workspace --exclude namada_benchmarks

build-test:
$(cargo) +$(nightly) build --tests $(jobs)
Expand All @@ -64,7 +64,8 @@ package: build-release

check-wasm = $(cargo) check --target wasm32-unknown-unknown --manifest-path $(wasm)/Cargo.toml
check:
$(cargo) check && \
$(cargo) check --workspace --exclude namada_benchmarks && \
$(cargo) +$(nightly) check --benches && \
tzemanovic marked this conversation as resolved.
Show resolved Hide resolved
make -C $(wasms) check && \
make -C $(wasms_for_tests) check && \
$(foreach wasm,$(wasm_templates),$(check-wasm) && ) true
Expand Down Expand Up @@ -149,7 +150,7 @@ test-integration:
# Clear pre-built proofs, run integration tests and save the new proofs
test-integration-save-proofs:
# Clear old proofs first
rm --force test_fixtures/masp_proofs/*.bin || true
rm -f test_fixtures/masp_proofs/*.bin || true
NAMADA_MASP_TEST_SEED=$(NAMADA_MASP_TEST_SEED) \
NAMADA_MASP_TEST_PROOFS=save \
TEST_FILTER=masp \
Expand Down Expand Up @@ -220,6 +221,9 @@ watch:
clean:
$(cargo) clean

bench:
$(cargo) bench

build-doc:
$(cargo) doc --no-deps

Expand Down Expand Up @@ -273,4 +277,4 @@ test-miri:
MIRIFLAGS="-Zmiri-disable-isolation" $(cargo) +$(nightly) miri test


.PHONY : build check build-release clippy install run-ledger run-gossip reset-ledger test test-debug fmt watch clean build-doc doc build-wasm-scripts-docker debug-wasm-scripts-docker build-wasm-scripts debug-wasm-scripts clean-wasm-scripts dev-deps test-miri test-unit
.PHONY : build check build-release clippy install run-ledger run-gossip reset-ledger test test-debug fmt watch clean build-doc doc build-wasm-scripts-docker debug-wasm-scripts-docker build-wasm-scripts debug-wasm-scripts clean-wasm-scripts dev-deps test-miri test-unit bench
13 changes: 9 additions & 4 deletions apps/src/bin/namada-client/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,16 @@ pub async fn main() -> Result<()> {
let tx = bridge_pool::build_bridge_pool_tx(
&client,
args.clone(),
signing_data.gas_payer.clone(),
signing_data.fee_payer.clone(),
)
.await?;

signing::generate_test_vector(&client, &mut ctx.wallet, &tx).await;
.await?;

signing::generate_test_vector(
&client,
&mut ctx.wallet,
&tx,
)
.await;

if args.tx.dump_tx {
dump_tx(&args.tx, tx);
Expand Down
Loading
Loading