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

Draft+3459+3463+hermes #3470

Closed
wants to merge 203 commits into from
Closed
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
203 commits
Select commit Hold shift + click to select a range
e02fe43
Now hash the TransferTarget into Transaction transparent outputs.
murisi May 28, 2024
6cbe813
Modified the MASP VP to check the IBC receivers.
murisi May 31, 2024
20d113b
Created a separate type that is either an Address or IBC receiver.
murisi Jun 1, 2024
031ba8a
empty commit
brentstone Jun 6, 2024
6daeaf7
Increase disposable key lifetime
sug0 Jun 6, 2024
e147d7a
Changelog for #3378
sug0 Jun 6, 2024
ca10451
Add block header Namada rpc handler
sug0 Jun 4, 2024
493e453
Implement date time subtraction
sug0 Jun 4, 2024
3cca791
Read epochs per year param
sug0 Jun 4, 2024
93112ea
Add max block duration estimate rpc method
sug0 Jun 4, 2024
64d974d
Retrieve max block time estimate from new rpc method in masp
sug0 Jun 4, 2024
acd92ee
use the new smooth-operator checked assign ops
tzemanovic Jun 5, 2024
183aa61
changelog: add #3374
tzemanovic Jun 5, 2024
743c154
remove check for maximum number of signatures per tx
brentstone Jun 6, 2024
dc23750
changelog: add #3380
brentstone Jun 6, 2024
8bb9f8c
Remove max expected block time param
sug0 Jun 4, 2024
7481d60
Split out `estimate_max_block_time_from_parameters`
sug0 Jun 4, 2024
6b71302
Insert mock block headers into test storage
sug0 Jun 5, 2024
996c48e
Test max block time estimates
sug0 Jun 5, 2024
beadc81
Avoid estimating block time of zero
sug0 Jun 5, 2024
eebf5d9
Import `namada_storage` with `testing` feat
sug0 Jun 5, 2024
2164904
Add additional test coverage for max expected block times
sug0 Jun 6, 2024
e9f5a46
Vectorizes transparent transfers
grarco Jun 2, 2024
36e215b
Vectorizes masp transfers
grarco Jun 3, 2024
3eff3b4
Fixes benchmarks
grarco Jun 3, 2024
453b211
Fixes signature generation for vectorized transfers
grarco Jun 4, 2024
4a94e0e
Check no vectorized transfers in cli
grarco Jun 6, 2024
9d6c19d
Misc improvements to signing for vectorized transfers
grarco Jun 6, 2024
561e4e8
Avoids reloading shielded context
grarco Jun 6, 2024
dd3f19a
shielded_token: store the total rewards minted by MASP
tzemanovic Jun 5, 2024
6d4ff88
sdk: add a query for MASP total rewards
tzemanovic Jun 5, 2024
054f915
client/rpc: print MASP total rewards in conversions query
tzemanovic Jun 5, 2024
3a77b4a
Fmt
grarco Jun 6, 2024
1e98403
Changelog #3356
grarco Jun 4, 2024
9b8aba6
cli: add shell completions generator
tzemanovic May 31, 2024
d776ff2
changelog: add #3343
tzemanovic May 31, 2024
69980be
Introduces masp fee payment
grarco May 29, 2024
40401f4
Passes the correct tx index to masp fee payment check
grarco May 29, 2024
bece3de
Reworks masp fee payment to correctly handle errors. Misc refactors
grarco May 29, 2024
3d9ccc4
`check_fees` checks masp fee payment
grarco May 30, 2024
25dbf81
`check_fees` drop the storage changes in case of failure
grarco May 30, 2024
d5aafd5
Returns `BatchedTxResult` from masp fee payment
grarco May 30, 2024
606a0f0
Renames fee payment gas limit parameter
grarco May 30, 2024
2f072b0
Skips the execution of the first inner tx when masp fee payment
grarco May 31, 2024
ba943ef
Refactors batch execution in case of masp fee payment
grarco May 31, 2024
75a2fdc
update Cargo.lock
brentstone Jun 6, 2024
07522e2
Adds integration tests for masp fee payment
grarco Jun 2, 2024
5a1b578
Removes write log precommit and leverages the batch log
grarco Jun 4, 2024
0e2b488
Different gas cost for storage deletes
grarco Jun 4, 2024
92aafe7
Refactors the write log api
grarco Jun 4, 2024
6cfe4c6
Merge branch 'tomas/checked-assign-ops' (#3374)
brentstone Jun 6, 2024
575cb0e
Merge branch 'tiago/increase-disposable-key-lifetime' (#3378)
brentstone Jun 6, 2024
dcdc548
Merge branch 'tomas/shell-complete' (#3343)
brentstone Jun 6, 2024
5581878
WIP
batconjurer May 24, 2024
2cae5c4
[feat]: Added ability to create snapshots of rocksDb
batconjurer Jun 6, 2024
b3ba1a7
add gas scale to protocol params
brentstone Jun 6, 2024
b0f851f
changelog: add #3375
tzemanovic Jun 6, 2024
bb835a1
[feat]: Added snapshot frequency to config
batconjurer Jun 6, 2024
8969ea0
changelog
batconjurer Jun 6, 2024
a0d05e6
empty commit
brentstone Jun 6, 2024
8bc54e5
Merge branch 'brent/remove-max-sigs' (#3380)
brentstone Jun 7, 2024
2b49dc0
Now check that the IBC events are valid with respect to storage changes.
murisi Jun 4, 2024
ad4bae8
Enforce fixed RFC3339 format
sug0 Jun 7, 2024
4582437
remove epoch multipler check for governance
Fraccaman Jun 7, 2024
7368256
Merge branch 'grarco/vectorize-transfers' (#3356)
brentstone Jun 7, 2024
aa7778f
remove hard-coded gas scale
brentstone Jun 7, 2024
4f793e7
Light error handling
brentstone Jun 7, 2024
18b76ac
Add datetime encoding tests
sug0 Jun 7, 2024
95c1e96
minors
Fraccaman Jun 7, 2024
c2a200a
minors
Fraccaman Jun 7, 2024
e6e9ba1
Merge branch 'tomas/masp-total-rewards' (#3375)
brentstone Jun 7, 2024
120ad8e
Adds support for masp fee payment in sdk
grarco Jun 6, 2024
584d2eb
Removes unused denominate function
grarco Jun 7, 2024
9f390a7
Updates shielded wasm code to handle fee unshielding
grarco Jun 7, 2024
abbf3b2
Split up the IBC validation logic in MASP.
murisi Jun 7, 2024
037f62f
fix and clean up
brentstone Jun 8, 2024
4980b18
some small changes
brentstone Jun 8, 2024
04ac10e
changelog: add #3390
brentstone Jun 9, 2024
468d423
changelog: add #3391
brentstone Jun 9, 2024
37e5995
fixes from comments
brentstone Jun 9, 2024
2039931
Merge branch 'fraccaman/remove-multipler-check-governance' (#3390)
brentstone Jun 10, 2024
112da61
change comment on Gas Display
brentstone Jun 10, 2024
fb0df69
Fixes masp tx generation and integration tests
grarco Jun 8, 2024
ed45335
Remove redundant TODO
sug0 Jun 11, 2024
b55f5bc
Centralized the construction of TransparentAddresses to ensure that e…
murisi Jun 11, 2024
0963ec3
Test inner tx results from batch tx
sug0 Jun 11, 2024
486e404
Changelog for #3401
sug0 Jun 11, 2024
5547f09
Handle the is_sender_chain_source case in the MASP VP.
murisi Jun 11, 2024
743dfec
Update crates/node/src/storage/rocksdb.rs
batconjurer Jun 12, 2024
06d7900
Update crates/node/src/storage/rocksdb.rs
batconjurer Jun 12, 2024
a6b0a29
review comments
batconjurer Jun 12, 2024
423ee7f
Ensure that native tokens can always be decoded.
murisi Jun 12, 2024
0ae6f2b
Reduced the dependence on IBC events.
murisi Jun 12, 2024
8740d8d
fix unit test
brentstone Jun 12, 2024
438a4ab
Merge branch 'base' into murisi/masp-ibc-replay-protection-using-txda…
murisi Jun 12, 2024
f768ef9
addressing review comment
batconjurer Jun 13, 2024
df8c15a
Added changelog
batconjurer Jun 7, 2024
594d26c
tinies
batconjurer Jun 8, 2024
f79afd1
rebasing
batconjurer Jun 12, 2024
217afe3
Masp fee payment for shielded actions
grarco Jun 12, 2024
d6f1206
decode transfer and NFT transfer messages
yito88 Jun 13, 2024
dbf6779
add changelog
yito88 Jun 13, 2024
2434e73
update Hermes
yito88 Jun 6, 2024
c4d788d
Decrease max block time estimate to 1m
sug0 Jun 13, 2024
db67411
Clue IBC max block time estimate from Namada params
sug0 Jun 13, 2024
13ea7b6
Adds missing gas spending key arg to ibc tx
grarco Jun 13, 2024
bab5cde
Changelog #3393
grarco Jun 13, 2024
17adaeb
Adjust IBC timeout values
sug0 Jun 13, 2024
48f58aa
Changelog for #3366
sug0 Jun 5, 2024
08e5664
Subdivided some functions involved in processing IBC packets.
murisi Jun 14, 2024
9698bb7
Panics in fee payment if balance read fails
grarco Jun 14, 2024
70f40a6
Fixes typo
grarco Jun 14, 2024
4f89335
Reuses token transfer
grarco Jun 14, 2024
8c2520e
Merge branch 'tiago/test-batch-tx-events' (#3401)
brentstone Jun 14, 2024
62ab4db
Merge branch 'tiago/remove-max-block-time-param' (#3366)
brentstone Jun 14, 2024
ed74656
Fixes broken docs
grarco Jun 14, 2024
d3c29e2
Upgrade ledger-namada-rs to 0.0.24.
murisi Jun 14, 2024
d6f9a7d
Added changelog entry.
murisi Jun 14, 2024
6026c42
Fixes masp amounts conversion
grarco Jun 16, 2024
d056b13
move masp validation from SDK into shielded_token crate
tzemanovic Jun 17, 2024
a088bdb
Derive inner tx hash using wrapper hash
sug0 Jun 14, 2024
dc0316c
Fixes typo
grarco Jun 18, 2024
d624cc8
Increase gas limit in `FinalizeBlock` tests
sug0 Jun 7, 2024
d43e301
Misc fixes
sug0 Jun 7, 2024
be6ed63
Fix from tm time impl for `DateTimeUtc`
sug0 Jun 7, 2024
b9cf51c
Improve tx salting
sug0 Jun 7, 2024
03ccc85
Increase robustness of datetime test
sug0 Jun 13, 2024
798dfe6
Switch to fixed offset format in UTC
sug0 Jun 13, 2024
6183a62
Keep nanoseconds during CometBFT time conversions
sug0 Jun 13, 2024
6050624
Fix genesis time in tests
sug0 Jun 13, 2024
8589b40
Increase precision of timestamps to 9 nanos
sug0 Jun 18, 2024
45c15e1
gen_localnet.py: Fix genesis time string
sug0 Jun 7, 2024
543942b
Rebuild wasms for tests
sug0 Jun 7, 2024
d1a9e54
Resign localnet genesis txs
sug0 Jun 7, 2024
bcad8e8
Regen tx fixtures
sug0 Jun 18, 2024
7f90393
Changelog for #3389
sug0 Jun 7, 2024
a2854e7
Now map denominations to tokens using ibc_token instead of reverse_qu…
murisi Jun 19, 2024
6739f0b
Removed is_any_shielded_action_balance_key and related code since tha…
murisi Jun 19, 2024
18fe989
Simplify checking packet acknowledgement by assuming the uniqueness o…
murisi Jun 19, 2024
3ca9912
Re-export `either` from `namada_tx`
sug0 Jun 19, 2024
ec1312b
Changelog for #3416
sug0 Jun 18, 2024
8de2ec0
Added more comments and improved function naming.
murisi Jun 19, 2024
0c999bd
Start using IBC ports to determine message formats.
murisi Jun 19, 2024
d0b4f3d
Now charge gas in IBC denom query.
murisi Jun 19, 2024
749c45a
Fixes ibc e2e test
grarco Jun 20, 2024
0a5d480
Update balances in the MASP using a non-mutating style.
murisi Jun 19, 2024
7ff94bd
Added changelog entry.
murisi Jun 20, 2024
76fab4c
Merge branch 'murisi/masp-ibc-replay-protection-using-txdata-on-0.39.…
murisi Jun 20, 2024
9e4d4c9
Removes useless write-log commit in fee payment
grarco Jun 21, 2024
13b4bcd
Renames misleading gas limit variable
grarco Jun 24, 2024
16a2c58
Updated example of expected string
grarco Jun 24, 2024
09df28b
Early sapling balance check in masp vp
grarco Jun 25, 2024
4f03fc3
shielded_token: feature guard validation to avoid compilation into wasm
tzemanovic Jun 17, 2024
d6212b9
changelog: add #3419
tzemanovic Jun 17, 2024
dd907d5
Changelog #2721
grarco Jun 25, 2024
a3bb632
Extracts the sapling value balance directly in `validate_transparent_…
grarco Jun 25, 2024
89b1f2c
Fallible trait bound for block height param in queries
grarco Jun 25, 2024
ec16fd2
Changelog #2891
grarco Jun 25, 2024
8363c34
added maximum amount of stewards as genesis parameter
Fraccaman Jun 25, 2024
ed9415f
improve logs
Fraccaman Jun 25, 2024
5fd8935
fix genesis files
Fraccaman Jun 25, 2024
88e520c
Merge branch 'tiago/consistent-datetime-serialization' (#3389)
brentstone Jun 25, 2024
0b2fb8f
fixup! Merge branch 'tiago/consistent-datetime-serialization' (#3389)
brentstone Jun 25, 2024
0c29ee3
Merge branch 'tiago/uniquely-identify-inner-txs' (#3416)
brentstone Jun 25, 2024
b3ae0f7
fixup! Merge branch 'tiago/uniquely-identify-inner-txs' (#3416)
brentstone Jun 25, 2024
5283608
Merge branch 'yuji/fix-ibc-message-decoding' (#3410)
brentstone Jun 25, 2024
fd0050f
Merge branch 'bat/feat/db-snapshots' (#3383)
brentstone Jun 25, 2024
34cfca6
Merge branch 'murisi/upgrade-ledger-namada-rs-dep' (#3412)
brentstone Jun 25, 2024
e1b5857
Removes fallback logic when failed fee payment
grarco Jun 25, 2024
7aebfda
bug fix: get correct storage key
brentstone Jun 26, 2024
8ac4fce
cleanup
brentstone Jun 26, 2024
3127b76
Generalized the TransparentTransfer to support a shielded action.
murisi Jun 27, 2024
83af4ba
Renamed TransparentTransfer to Transfer.
murisi Jun 27, 2024
6d1b785
Subsumed shielded transfer into generalized transfer.
murisi Jun 27, 2024
7942919
Subsumed shielding transfer into generalized transfer.
murisi Jun 27, 2024
7a80d59
Subsumed unshielding transfer into generalized transfer.
murisi Jun 27, 2024
29a64eb
Remove now dead code.
murisi Jun 27, 2024
25d9675
evil: update hermes
brentstone Jun 27, 2024
cc9d719
Merge branch 'bat/feat/list-and-offer-snapshots' (#3386)
brentstone Jun 28, 2024
267eda2
changelog: add #3442
brentstone Jun 26, 2024
48dfdb5
Merge branch 'fraccaman/limit-pgf-stewards' (#3442)
brentstone Jun 28, 2024
36ab80e
Merge branch 'grarco/sdk-query-height' (#3441)
brentstone Jun 28, 2024
e9dd1b2
Merge branch 'brent/parameterize-gas-scale' (#3391)
brentstone Jun 28, 2024
fef8a91
Merge branch 'tomas/move-verify-shielded' (#3419)
brentstone Jun 28, 2024
a2e101a
change IBC e2e test config
yito88 Jun 28, 2024
52adb35
clear on start
yito88 Jun 28, 2024
2f9f3c8
add changelog
yito88 Jun 28, 2024
900e162
longer interval
yito88 Jun 28, 2024
3046602
MASP section hash is now based on Transaction bytes.
murisi Jun 28, 2024
9aa04e9
Merge branch 'grarco/masp-fee-payment' (#3393)
brentstone Jun 28, 2024
7dd97fa
evil: fix masp fee payment
brentstone Jun 28, 2024
2936ba2
Merge branch 'grarco/early-sapling-balance-check' (#3439)
brentstone Jun 28, 2024
4455bba
evil: update hermes
brentstone Jun 28, 2024
50d9246
Use txids to reference MASP Transactions from Transfers and MaspBuild…
murisi Jun 28, 2024
c7a4524
Added changelog entry.
murisi Jun 28, 2024
ddded01
Added a changelog entry.
murisi Jun 28, 2024
6110726
Renamed some data structures.
murisi Jul 1, 2024
317b3ad
Unconstrain transfers and combine transfer amounts.
murisi Jun 28, 2024
d7879bc
Merge branch 'murisi/unconstrained-transfers' (#3459)
murisi Jul 1, 2024
b908ac8
Merge branch 'murisi/non-malleable-masp-witness-data2' (#3463)
murisi Jul 1, 2024
9cbc4ee
evil: update hermes
brentstone Jul 1, 2024
ee07866
Merge branch 'yuji/ibc-e2e-config' (#3455)
brentstone Jul 2, 2024
140ab53
evil: revert unexpected change
yito88 Jul 2, 2024
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Combined the various Transfer formats into one general one.
([\#3446](https://github.com/anoma/namada/pull/3446))
17 changes: 8 additions & 9 deletions crates/apps_lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3127,11 +3127,10 @@ pub mod args {
TX_CHANGE_METADATA_WASM, TX_CLAIM_REWARDS_WASM,
TX_DEACTIVATE_VALIDATOR_WASM, TX_IBC_WASM, TX_INIT_ACCOUNT_WASM,
TX_INIT_PROPOSAL, TX_REACTIVATE_VALIDATOR_WASM, TX_REDELEGATE_WASM,
TX_RESIGN_STEWARD, TX_REVEAL_PK, TX_SHIELDED_TRANSFER_WASM,
TX_SHIELDING_TRANSFER_WASM, TX_TRANSPARENT_TRANSFER_WASM,
TX_UNBOND_WASM, TX_UNJAIL_VALIDATOR_WASM, TX_UNSHIELDING_TRANSFER_WASM,
TX_UPDATE_ACCOUNT_WASM, TX_UPDATE_STEWARD_COMMISSION, TX_VOTE_PROPOSAL,
TX_WITHDRAW_WASM, VP_USER_WASM,
TX_RESIGN_STEWARD, TX_REVEAL_PK, TX_TRANSFER_WASM, TX_UNBOND_WASM,
TX_UNJAIL_VALIDATOR_WASM, TX_UPDATE_ACCOUNT_WASM,
TX_UPDATE_STEWARD_COMMISSION, TX_VOTE_PROPOSAL, TX_WITHDRAW_WASM,
VP_USER_WASM,
};
use namada_sdk::DEFAULT_GAS_LIMIT;

Expand Down Expand Up @@ -4394,7 +4393,7 @@ pub mod args {
let target = TARGET.parse(matches);
let token = TOKEN.parse(matches);
let amount = InputAmount::Unvalidated(AMOUNT.parse(matches));
let tx_code_path = PathBuf::from(TX_TRANSPARENT_TRANSFER_WASM);
let tx_code_path = PathBuf::from(TX_TRANSFER_WASM);
let data = vec![TxTransparentTransferData {
source,
target,
Expand Down Expand Up @@ -4467,7 +4466,7 @@ pub mod args {
let target = PAYMENT_ADDRESS_TARGET.parse(matches);
let token = TOKEN.parse(matches);
let amount = InputAmount::Unvalidated(AMOUNT.parse(matches));
let tx_code_path = PathBuf::from(TX_SHIELDED_TRANSFER_WASM);
let tx_code_path = PathBuf::from(TX_TRANSFER_WASM);
let data = vec![TxShieldedTransferData {
source,
target,
Expand Down Expand Up @@ -4547,7 +4546,7 @@ pub mod args {
let target = PAYMENT_ADDRESS_TARGET.parse(matches);
let token = TOKEN.parse(matches);
let amount = InputAmount::Unvalidated(AMOUNT.parse(matches));
let tx_code_path = PathBuf::from(TX_SHIELDING_TRANSFER_WASM);
let tx_code_path = PathBuf::from(TX_TRANSFER_WASM);
let data = vec![TxShieldingTransferData {
source,
token,
Expand Down Expand Up @@ -4625,7 +4624,7 @@ pub mod args {
let target = TARGET.parse(matches);
let token = TOKEN.parse(matches);
let amount = InputAmount::Unvalidated(AMOUNT.parse(matches));
let tx_code_path = PathBuf::from(TX_UNSHIELDING_TRANSFER_WASM);
let tx_code_path = PathBuf::from(TX_TRANSFER_WASM);
let data = vec![TxUnshieldingTransferData {
target,
token,
Expand Down
27 changes: 14 additions & 13 deletions crates/benches/host_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,30 @@ use namada::core::account::AccountPublicKeysMap;
use namada::core::address;
use namada::core::collections::{HashMap, HashSet};
use namada::ledger::storage::DB;
use namada::token::{Amount, TransparentTransfer, TransparentTransferData};
use namada::token::{Amount, Transfer};
use namada::tx::Authorization;
use namada::vm::wasm::TxCache;
use namada_apps_lib::wallet::defaults;
use namada_apps_lib::wasm_loader;
use namada_node::bench_utils::{
BenchShell, TX_INIT_PROPOSAL_WASM, TX_REVEAL_PK_WASM,
TX_TRANSPARENT_TRANSFER_WASM, TX_UPDATE_ACCOUNT_WASM, VP_USER_WASM,
WASM_DIR,
BenchShell, TX_INIT_PROPOSAL_WASM, TX_REVEAL_PK_WASM, TX_TRANSFER_WASM,
TX_UPDATE_ACCOUNT_WASM, VP_USER_WASM, WASM_DIR,
};

// Benchmarks the validation of a single signature on a single `Section` of a
// transaction
fn tx_section_signature_validation(c: &mut Criterion) {
let shell = BenchShell::default();
let transfer_data = TransparentTransfer(vec![TransparentTransferData {
source: defaults::albert_address(),
target: defaults::bertha_address(),
token: address::testing::nam(),
amount: Amount::native_whole(500).native_denominated(),
}]);
let transfer_data = Transfer::default()
.transfer(
defaults::albert_address(),
defaults::bertha_address(),
address::testing::nam(),
Amount::native_whole(500).native_denominated(),
)
.unwrap();
let tx = shell.generate_tx(
TX_TRANSPARENT_TRANSFER_WASM,
TX_TRANSFER_WASM,
transfer_data,
None,
None,
Expand Down Expand Up @@ -62,7 +63,7 @@ fn compile_wasm(c: &mut Criterion) {
let mut txs: HashMap<&str, Vec<u8>> = HashMap::default();

for tx in [
TX_TRANSPARENT_TRANSFER_WASM,
TX_TRANSFER_WASM,
TX_INIT_PROPOSAL_WASM,
TX_REVEAL_PK_WASM,
TX_UPDATE_ACCOUNT_WASM,
Expand Down Expand Up @@ -111,7 +112,7 @@ fn untrusted_wasm_validation(c: &mut Criterion) {
let mut txs: HashMap<&str, Vec<u8>> = HashMap::default();

for tx in [
TX_TRANSPARENT_TRANSFER_WASM,
TX_TRANSFER_WASM,
TX_INIT_PROPOSAL_WASM,
TX_REVEAL_PK_WASM,
TX_UPDATE_ACCOUNT_WASM,
Expand Down
21 changes: 11 additions & 10 deletions crates/benches/native_vps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,14 @@ use namada::sdk::masp_primitives::merkle_tree::CommitmentTree;
use namada::sdk::masp_primitives::transaction::Transaction;
use namada::sdk::masp_proofs::sapling::SaplingVerificationContextInner;
use namada::state::{Epoch, StorageRead, StorageWrite, TxIndex};
use namada::token::{Amount, TransparentTransfer, TransparentTransferData};
use namada::token::{Amount, Transfer};
use namada::tx::{BatchedTx, Code, Section, Tx};
use namada_apps_lib::wallet::defaults;
use namada_node::bench_utils::{
generate_foreign_key_tx, BenchShell, BenchShieldedCtx,
ALBERT_PAYMENT_ADDRESS, ALBERT_SPENDING_KEY, BERTHA_PAYMENT_ADDRESS,
TX_BRIDGE_POOL_WASM, TX_IBC_WASM, TX_INIT_PROPOSAL_WASM, TX_RESIGN_STEWARD,
TX_TRANSPARENT_TRANSFER_WASM, TX_UPDATE_STEWARD_COMMISSION,
TX_VOTE_PROPOSAL_WASM,
TX_TRANSFER_WASM, TX_UPDATE_STEWARD_COMMISSION, TX_VOTE_PROPOSAL_WASM,
};
use rand_core::OsRng;

Expand Down Expand Up @@ -475,13 +474,15 @@ fn vp_multitoken(c: &mut Criterion) {
generate_foreign_key_tx(&defaults::albert_keypair());

let transfer = shell.generate_tx(
TX_TRANSPARENT_TRANSFER_WASM,
TransparentTransfer(vec![TransparentTransferData {
source: defaults::albert_address(),
target: defaults::bertha_address(),
token: address::testing::nam(),
amount: Amount::native_whole(1000).native_denominated(),
}]),
TX_TRANSFER_WASM,
Transfer::default()
.transfer(
defaults::albert_address(),
defaults::bertha_address(),
address::testing::nam(),
Amount::native_whole(1000).native_denominated(),
)
.unwrap(),
None,
None,
vec![&defaults::albert_keypair()],
Expand Down
22 changes: 11 additions & 11 deletions crates/benches/process_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ use namada::core::key::RefTo;
use namada::core::storage::BlockHeight;
use namada::core::time::DateTimeUtc;
use namada::state::TxIndex;
use namada::token::{
Amount, DenominatedAmount, TransparentTransfer, TransparentTransferData,
};
use namada::token::{Amount, DenominatedAmount, Transfer};
use namada::tx::data::{Fee, WrapperTx};
use namada::tx::Authorization;
use namada_apps_lib::wallet::defaults;
use namada_node::bench_utils::{BenchShell, TX_TRANSPARENT_TRANSFER_WASM};
use namada_node::bench_utils::{BenchShell, TX_TRANSFER_WASM};
use namada_node::shell::process_proposal::ValidationMeta;

fn process_tx(c: &mut Criterion) {
Expand All @@ -21,13 +19,15 @@ fn process_tx(c: &mut Criterion) {
BlockHeight(2);

let mut batched_tx = shell.generate_tx(
TX_TRANSPARENT_TRANSFER_WASM,
TransparentTransfer(vec![TransparentTransferData {
source: defaults::albert_address(),
target: defaults::bertha_address(),
token: address::testing::nam(),
amount: Amount::native_whole(1).native_denominated(),
}]),
TX_TRANSFER_WASM,
Transfer::default()
.transfer(
defaults::albert_address(),
defaults::bertha_address(),
address::testing::nam(),
Amount::native_whole(1).native_denominated(),
)
.unwrap(),
None,
None,
vec![&defaults::albert_keypair()],
Expand Down
21 changes: 5 additions & 16 deletions crates/encoding_spec/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let signature_schema = schema_container_of::<Signature>();
let init_account_schema = schema_container_of::<account::InitAccount>();
let init_validator_schema = schema_container_of::<pos::BecomeValidator>();
let transparent_transfer_schema =
schema_container_of::<token::TransparentTransfer>();
let shielded_transfer_schema =
schema_container_of::<token::ShieldedTransfer>();
let shielding_transfer_schema =
schema_container_of::<token::ShieldingTransfer>();
let unshielding_transfer_schema =
schema_container_of::<token::UnshieldingTransfer>();
let transfer_schema = schema_container_of::<token::Transfer>();
let update_account = schema_container_of::<account::UpdateAccount>();
let pos_bond_schema = schema_container_of::<pos::Bond>();
let pos_withdraw_schema = schema_container_of::<pos::Withdraw>();
Expand All @@ -115,10 +108,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
definitions.extend(btree(&signature_schema));
definitions.extend(btree(&init_account_schema));
definitions.extend(btree(&init_validator_schema));
definitions.extend(btree(&transparent_transfer_schema));
definitions.extend(btree(&shielded_transfer_schema));
definitions.extend(btree(&shielding_transfer_schema));
definitions.extend(btree(&unshielding_transfer_schema));
definitions.extend(btree(&transfer_schema));
definitions.extend(btree(&update_account));
definitions.extend(btree(&pos_bond_schema));
definitions.extend(btree(&pos_withdraw_schema));
Expand Down Expand Up @@ -191,11 +181,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
).with_rust_doc_link("https://dev.namada.net/master/rustdoc/namada/types/transaction/struct.InitValidator.html");
tables.push(init_validator_table);

let token_transfer_definition = definitions
.remove(transparent_transfer_schema.declaration())
.unwrap();
let token_transfer_definition =
definitions.remove(transfer_schema.declaration()).unwrap();
let token_transfer_table = definition_to_table(
transparent_transfer_schema.declaration(),
transfer_schema.declaration(),
token_transfer_definition,
).with_rust_doc_link("https://dev.namada.net/master/rustdoc/namada/types/token/struct.Transfer.html");
tables.push(token_transfer_table);
Expand Down
1 change: 0 additions & 1 deletion crates/ibc/src/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ where
let data = MsgTransfer {
message,
transfer: None,
fee_unshield: None,
}
.serialize_to_vec();

Expand Down
21 changes: 8 additions & 13 deletions crates/ibc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ use ibc::primitives::proto::Any;
pub use ibc::*;
pub use msg::*;
use namada_core::address::{self, Address};
use namada_token::{ShieldingTransfer, UnshieldingTransferData};
use namada_token::Transfer;
pub use nft::*;
use prost::Message;
use thiserror::Error;
Expand Down Expand Up @@ -154,10 +154,7 @@ where
pub fn execute(
&mut self,
tx_data: &[u8],
) -> Result<
(Option<ShieldingTransfer>, Option<UnshieldingTransferData>),
Error,
> {
) -> Result<Option<Transfer>, Error> {
let message = decode_message(tx_data)?;
match &message {
IbcMessage::Transfer(msg) => {
Expand All @@ -172,7 +169,7 @@ where
msg.message.clone(),
)
.map_err(Error::TokenTransfer)?;
Ok((msg.transfer.clone(), msg.fee_unshield.clone()))
Ok(msg.transfer.clone())
}
IbcMessage::NftTransfer(msg) => {
let mut nft_transfer_ctx =
Expand All @@ -183,7 +180,7 @@ where
msg.message.clone(),
)
.map_err(Error::NftTransfer)?;
Ok((msg.transfer.clone(), msg.fee_unshield.clone()))
Ok(msg.transfer.clone())
}
IbcMessage::RecvPacket(msg) => {
let envelope =
Expand All @@ -196,7 +193,7 @@ where
} else {
None
};
Ok((transfer, None))
Ok(transfer)
}
IbcMessage::AckPacket(msg) => {
let envelope =
Expand All @@ -210,20 +207,20 @@ where
} else {
None
};
Ok((transfer, None))
Ok(transfer)
}
IbcMessage::Timeout(msg) => {
let envelope = MsgEnvelope::Packet(PacketMsg::Timeout(
msg.message.clone(),
));
execute(&mut self.ctx, &mut self.router, envelope)
.map_err(|e| Error::Context(Box::new(e)))?;
Ok((msg.transfer.clone(), None))
Ok(msg.transfer.clone())
}
IbcMessage::Envelope(envelope) => {
execute(&mut self.ctx, &mut self.router, *envelope.clone())
.map_err(|e| Error::Context(Box::new(e)))?;
Ok((None, None))
Ok(None)
}
}
}
Expand Down Expand Up @@ -338,15 +335,13 @@ pub fn decode_message(tx_data: &[u8]) -> Result<IbcMessage, Error> {
let msg = MsgTransfer {
message,
transfer: None,
fee_unshield: None,
};
return Ok(IbcMessage::Transfer(msg));
}
if let Ok(message) = IbcMsgNftTransfer::try_from(any_msg) {
let msg = MsgNftTransfer {
message,
transfer: None,
fee_unshield: None,
};
return Ok(IbcMessage::NftTransfer(msg));
}
Expand Down
Loading
Loading