Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
6c81768
Implement IBC account ids
sug0 Oct 16, 2025
f8be657
Insert MASP as verifier from IBC payment addr signer
sug0 Oct 16, 2025
ae2948a
Rename `is_shielded` field to `has_masp_tx`
sug0 Oct 16, 2025
c8ef30e
Add shielded token store
sug0 Oct 16, 2025
4ba43bd
Integrate shielded token store with IBC VP
sug0 Oct 17, 2025
d3d7d4e
Encode MASP payment addrs with bech32 legacy codec
sug0 Oct 17, 2025
4f55905
Create note from MASP payment addr
sug0 Oct 17, 2025
fe8b410
IBC account id helper predicates
sug0 Oct 17, 2025
ca6d710
Make IBC amount conversions infallible
sug0 Oct 17, 2025
7d417a1
Mint MASP notes via IBC
sug0 Oct 17, 2025
2f72d1c
Remove storage impls from ibc protocol ctx
sug0 Oct 20, 2025
cf07ab2
Simplify params bounds in ibc transfer def
sug0 Oct 20, 2025
ce601ae
Integrate transparent token store with IBC VP
sug0 Oct 20, 2025
5e10bab
Read token denom from storage when minting MASP note
sug0 Oct 20, 2025
6ba4f78
Keep track of nr of MASP IBC shieldings
sug0 Oct 21, 2025
bb2530e
Seed MASP note with IBC shielding counter
sug0 Oct 21, 2025
2349e6d
Integrate params store with IBC transfer ctx
sug0 Oct 21, 2025
f9d7307
Add convenience method to compute MASP epoch
sug0 Oct 21, 2025
95b0d86
Expose storage predicate to check if a conversion exists
sug0 Oct 21, 2025
83dddcb
Attribute epochs to shielded IBC assets
sug0 Oct 21, 2025
b9bef5e
Remove unused type
sug0 Oct 21, 2025
750b37d
Relocate compact notes to core
sug0 Oct 21, 2025
8c1d4ea
Serde serialize compact notes
sug0 Oct 21, 2025
5c8ceda
Add new type of MASP event for unencypted notes
sug0 Oct 21, 2025
54d1172
Make IBC ctx event emission generic
sug0 Oct 21, 2025
ecd471d
Emit MASP shielding events from IBC ctx
sug0 Oct 21, 2025
4b78ec2
Replace tx index with more generic indexed tx in protocol
sug0 Oct 22, 2025
3784571
Store indexed tx in tx/vp ctx
sug0 Oct 22, 2025
d71ff69
Repurpose `get_tx_index` host fn to retrieve indexed tx
sug0 Oct 22, 2025
a7c4389
Create indexed tx from tuple
sug0 Oct 22, 2025
02e6d7b
Set proper tx index in IBC shielding MASP event
sug0 Oct 22, 2025
e87bc92
Add convenience method to get transp addr from IbcAccountId
sug0 Oct 22, 2025
077421b
Replace matches with to_address
sug0 Oct 22, 2025
57518ba
Activate MASP note minting via IBC
sug0 Oct 22, 2025
d42aa82
Revert "Delete unused test helper fn"
sug0 Oct 23, 2025
f5d88b7
Avoid overriding receiver in some IBC e2e tests
sug0 Oct 23, 2025
30da556
Test IBC transfers to and from payment addrs
sug0 Oct 23, 2025
a1bd7c8
Extend MASP events with IBC protocol shielding attrs
sug0 Oct 24, 2025
d932b12
Tag IBC protocol shieldings
sug0 Oct 24, 2025
111445d
Expose MASP tx extraction in SDK
sug0 Oct 27, 2025
900ed8e
Generate dummy MASP transactions from unencrypted notes
sug0 Oct 27, 2025
5f4ba69
Test dummy masp tx note trial decryption
sug0 Oct 27, 2025
432cfac
Add storage method to write MASP undated asset balance
sug0 Oct 27, 2025
8dc772a
Augment shielded token store with undated asset balance methods
sug0 Oct 27, 2025
9383497
Increment undated asset balance in IBC shieldings
sug0 Oct 27, 2025
aca8736
Fix frontend sus fee comments on sdk args
sug0 Oct 27, 2025
e43731b
Set payment addr as shielded refund target
sug0 Oct 27, 2025
78c283c
Test IBC shielded refunding
sug0 Oct 27, 2025
6c76cbc
Enable new IBC test in CI
sug0 Oct 27, 2025
ea7ef2f
Receive shielded swaps into payment addr
sug0 Oct 28, 2025
810524a
Remove sus fee from shielded swaps args
sug0 Oct 28, 2025
8889b97
Handle refunds on IBC ack errors and timeouts
sug0 Oct 30, 2025
f35af42
Allow IBC memoless shieldings in MASP VP
sug0 Oct 30, 2025
e1d5a33
Refactor IBC shielding state updates
sug0 Oct 31, 2025
d8d0208
Read in-memory values from a virtual storage space
sug0 Oct 31, 2025
2e3409d
Replace conversions host fns with virtual storage reads
sug0 Nov 3, 2025
a870489
Refactor compact note borsh impl
sug0 Nov 3, 2025
93097e6
Reject MASP transfers that attempt to mint IBC tokens twice
sug0 Nov 3, 2025
a782e78
Fix IBC e2e test Gaia timeout
sug0 Nov 3, 2025
8d1fe26
Test rewards in IBC memoless shieldings
sug0 Nov 3, 2025
7593865
Increase IBC test time in CI
sug0 Nov 3, 2025
3399ece
Fix Osmosis shielded swaps
sug0 Nov 4, 2025
5502617
Deny payment addr as a refund target of transparent transfers
sug0 Nov 4, 2025
f3a8887
Check if protocol shieldings revealed nullifiers
sug0 Nov 5, 2025
0002d4f
Re-export `either` crate from `namada_core`
sug0 Nov 6, 2025
fd74fc3
Refine validation of shielded data source in MASP VP
sug0 Nov 6, 2025
fb4c466
Use checked arith to compute sapling balance
sug0 Nov 6, 2025
ed70e61
Changelog for #4939
sug0 Oct 30, 2025
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
4 changes: 4 additions & 0 deletions .changelog/unreleased/improvements/4939-znam-ibc-shielding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Allow IBC deposits into payment addresses (without generating MASP
transactions), and IBC withdraws from payment addresses (to automatically
get refunded, if an IBC unshielding transfer fails on the counter-party).
([\#4939](https://github.com/namada-net/namada/pull/4939))
1 change: 1 addition & 0 deletions .github/workflows/scripts/e2e.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"e2e::eth_bridge_tests::everything": 4,
"e2e::ibc_tests::ibc_to_and_from_payment_addrs": 840,
"e2e::ibc_tests::frontend_sus_fee": 350,
"e2e::ibc_tests::ibc_transfers": 414,
"e2e::ibc_tests::ibc_nft_transfers": 224,
Expand Down
3 changes: 2 additions & 1 deletion Cargo.lock

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

17 changes: 0 additions & 17 deletions crates/apps_lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3623,7 +3623,6 @@ pub mod args {
arg_opt("output-folder-path");
pub const OSMOSIS_POOL_HOP: ArgMulti<OsmosisPoolHop, GlobStar> =
arg_multi("pool-hop");
pub const OVERFLOW_OPT: ArgOpt<WalletAddress> = arg_opt("overflow-addr");
pub const OWNER: Arg<WalletAddress> = arg("owner");
pub const OWNER_OPT: ArgOpt<WalletAddress> = OWNER.opt();
pub const PATH: Arg<PathBuf> = arg("path");
Expand Down Expand Up @@ -5311,18 +5310,15 @@ pub mod args {
Either::Left(r) => Either::Left(chain_ctx.get(&r)),
Either::Right(r) => Either::Right(chain_ctx.get(&r)),
};
let overflow = self.overflow.map(|r| chain_ctx.get(&r));
Ok(TxOsmosisSwap {
transfer: self.transfer.to_sdk(ctx)?,
output_denom: self.output_denom,
recipient,
overflow,
slippage: self.slippage,
local_recovery_addr: self.local_recovery_addr,
route: self.route,
osmosis_lcd_rpc: self.osmosis_lcd_rpc,
osmosis_sqs_rpc: self.osmosis_sqs_rpc,
frontend_sus_fee: None,
})
}
}
Expand All @@ -5336,7 +5332,6 @@ pub mod args {
let maybe_trans_recipient = TARGET_OPT.parse(matches);
let maybe_shielded_recipient =
PAYMENT_ADDRESS_TARGET_OPT.parse(matches);
let maybe_overflow = OVERFLOW_OPT.parse(matches);
let slippage_percent = SLIPPAGE.parse(matches);
if slippage_percent.is_some_and(|percent| {
let zero = Dec::zero();
Expand Down Expand Up @@ -5369,13 +5364,11 @@ pub mod args {
} else {
Either::Right(maybe_shielded_recipient.unwrap())
},
overflow: maybe_overflow,
slippage,
local_recovery_addr,
route,
osmosis_lcd_rpc,
osmosis_sqs_rpc,
frontend_sus_fee: None,
}
}

Expand Down Expand Up @@ -5409,7 +5402,6 @@ pub mod args {
.arg(
TARGET_OPT
.def()
.conflicts_with(OVERFLOW_OPT.name)
.conflicts_with(PAYMENT_ADDRESS_TARGET_OPT.name)
.help(wrap!(
"Transparent Namada address that shall receive \
Expand All @@ -5425,15 +5417,6 @@ pub mod args {
minimum amount of tokens swapped on Osmosis."
)),
)
.arg(OVERFLOW_OPT.def().help(wrap!(
"Transparent address that receives the amount of target \
asset exceeding the minimum trade amount. Only \
applicable when shielding assets that have been swapped \
on Osmosis. This address should not be linkable to any \
of the user's personal accounts, to maximize the privacy \
of the trade. If unspecified, a disposable address is \
generated."
)))
.arg(SLIPPAGE.def().help(wrap!(
"Slippage percentage, as a number between 0 and 100. \
Represents the maximum acceptable deviation from the \
Expand Down
85 changes: 52 additions & 33 deletions crates/benches/native_vps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ use namada_apps_lib::masp_primitives::merkle_tree::CommitmentTree;
use namada_apps_lib::masp_primitives::transaction::Transaction;
use namada_apps_lib::masp_proofs::sapling::SaplingVerificationContextInner;
use namada_apps_lib::proof_of_stake::KeySeg;
use namada_apps_lib::state::{Epoch, StorageRead, StorageWrite, TxIndex};
use namada_apps_lib::state::{Epoch, StorageRead, StorageWrite};
use namada_apps_lib::token::masp::{
PVKs, partial_deauthorize, preload_verifying_keys,
};
use namada_apps_lib::token::{Amount, Transfer};
use namada_apps_lib::tx::{BatchedTx, Code, Section, Tx};
use namada_apps_lib::tx::{BatchedTx, Code, IndexedTx, Section, Tx};
use namada_apps_lib::validation::{
EthBridgeNutVp, EthBridgePoolVp, EthBridgeVp, GovernanceVp, IbcVp,
IbcVpContext, MaspVp, MultitokenVp, ParametersVp, PgfVp, PosVp,
Expand Down Expand Up @@ -222,12 +222,13 @@ fn governance(c: &mut Criterion) {
let gas_meter = RefCell::new(VpGasMeter::new_from_tx_meter(
&TxGasMeter::new(u64::MAX, 1),
));
let indexed_tx = IndexedTx::default();
let ctx = Ctx::new(
&Address::Internal(InternalAddress::Governance),
&shell.state,
&signed_tx.tx,
&signed_tx.cmt,
&TxIndex(0),
&indexed_tx,
&gas_meter,
&keys_changed,
&verifiers,
Expand Down Expand Up @@ -294,13 +295,14 @@ fn governance(c: &mut Criterion) {
// .write_log
// .verifiers_and_changed_keys(&verifiers_from_tx);

// let indexed_tx = IndexedTx::default();
// let slash_fund = SlashFundVp {
// ctx: Ctx::new(
// &Address::Internal(InternalAddress::SlashFund),
// &shell.state.storage,
// &shell.state.write_log,
// &tx,
// &TxIndex(0),
// &indexed_tx,
//
// VpGasMeter::new_from_tx_meter(&TxGasMeter::new(
// u64::MAX.into(), )),
Expand Down Expand Up @@ -451,12 +453,13 @@ fn ibc(c: &mut Criterion) {
&TxGasMeter::new(u64::MAX, 1),
));
let shell_read = shielded_ctx.shell.read();
let indexed_tx = IndexedTx::default();
let ibc = IbcVp::new(Ctx::new(
&Address::Internal(InternalAddress::Ibc),
&shell_read.state,
&signed_tx.tx,
&signed_tx.cmt,
&TxIndex(0),
&indexed_tx,
&gas_meter,
&keys_changed,
&verifiers,
Expand Down Expand Up @@ -519,12 +522,13 @@ fn vp_multitoken(c: &mut Criterion) {
let gas_meter = RefCell::new(VpGasMeter::new_from_tx_meter(
&TxGasMeter::new(u64::MAX, 1),
));
let indexed_tx = IndexedTx::default();
let ctx = Ctx::new(
&Address::Internal(InternalAddress::Multitoken),
&shell.state,
&signed_tx.tx,
&signed_tx.cmt,
&TxIndex(0),
&indexed_tx,
&gas_meter,
&keys_changed,
&verifiers,
Expand Down Expand Up @@ -644,12 +648,13 @@ fn masp(c: &mut Criterion) {
let gas_meter = RefCell::new(VpGasMeter::new_from_tx_meter(
&TxGasMeter::new(u64::MAX, 1),
));
let indexed_tx = IndexedTx::default();
let ctx = Ctx::new(
&Address::Internal(InternalAddress::Masp),
&shell_read.state,
&signed_tx.tx,
&signed_tx.cmt,
&TxIndex(0),
&indexed_tx,
&gas_meter,
&keys_changed,
&verifiers,
Expand Down Expand Up @@ -1271,12 +1276,13 @@ fn pgf(c: &mut Criterion) {
let gas_meter = RefCell::new(VpGasMeter::new_from_tx_meter(
&TxGasMeter::new(u64::MAX, 1),
));
let indexed_tx = IndexedTx::default();
let ctx = Ctx::new(
&Address::Internal(InternalAddress::Pgf),
&shell.state,
&signed_tx.tx,
&signed_tx.cmt,
&TxIndex(0),
&indexed_tx,
&gas_meter,
&keys_changed,
&verifiers,
Expand Down Expand Up @@ -1349,12 +1355,13 @@ fn eth_bridge_nut(c: &mut Criterion) {
let gas_meter = RefCell::new(VpGasMeter::new_from_tx_meter(
&TxGasMeter::new(u64::MAX, 1),
));
let indexed_tx = IndexedTx::default();
let ctx = Ctx::new(
&vp_address,
&shell.state,
&signed_tx.tx,
&signed_tx.cmt,
&TxIndex(0),
&indexed_tx,
&gas_meter,
&keys_changed,
&verifiers,
Expand Down Expand Up @@ -1423,12 +1430,13 @@ fn eth_bridge(c: &mut Criterion) {
let gas_meter = RefCell::new(VpGasMeter::new_from_tx_meter(
&TxGasMeter::new(u64::MAX, 1),
));
let indexed_tx = IndexedTx::default();
let ctx = Ctx::new(
&vp_address,
&shell.state,
&signed_tx.tx,
&signed_tx.cmt,
&TxIndex(0),
&indexed_tx,
&gas_meter,
&keys_changed,
&verifiers,
Expand Down Expand Up @@ -1522,12 +1530,13 @@ fn eth_bridge_pool(c: &mut Criterion) {
let gas_meter = RefCell::new(VpGasMeter::new_from_tx_meter(
&TxGasMeter::new(u64::MAX, 1),
));
let indexed_tx = IndexedTx::default();
let ctx = Ctx::new(
&vp_address,
&shell.state,
&signed_tx.tx,
&signed_tx.cmt,
&TxIndex(0),
&indexed_tx,
&gas_meter,
&keys_changed,
&verifiers,
Expand Down Expand Up @@ -1596,12 +1605,13 @@ fn parameters(c: &mut Criterion) {
let gas_meter = RefCell::new(VpGasMeter::new_from_tx_meter(
&TxGasMeter::new(u64::MAX, 1),
));
let indexed_tx = IndexedTx::default();
let ctx = Ctx::new(
&vp_address,
&shell.state,
&signed_tx.tx,
&signed_tx.cmt,
&TxIndex(0),
&indexed_tx,
&gas_meter,
&keys_changed,
&verifiers,
Expand Down Expand Up @@ -1673,12 +1683,13 @@ fn pos(c: &mut Criterion) {
let gas_meter = RefCell::new(VpGasMeter::new_from_tx_meter(
&TxGasMeter::new(u64::MAX, 1),
));
let indexed_tx = IndexedTx::default();
let ctx = Ctx::new(
&vp_address,
&shell.state,
&signed_tx.tx,
&signed_tx.cmt,
&TxIndex(0),
&indexed_tx,
&gas_meter,
&keys_changed,
&verifiers,
Expand Down Expand Up @@ -1727,12 +1738,13 @@ fn ibc_vp_validate_action(c: &mut Criterion) {
let gas_meter = RefCell::new(VpGasMeter::new_from_tx_meter(
&TxGasMeter::new(u64::MAX, 1),
));
let indexed_tx = IndexedTx::default();
let ibc = IbcVp::new(Ctx::new(
&Address::Internal(InternalAddress::Ibc),
&shell_read.state,
&signed_tx.tx,
&signed_tx.cmt,
&TxIndex(0),
&indexed_tx,
&gas_meter,
&keys_changed,
&verifiers,
Expand All @@ -1745,17 +1757,20 @@ fn ibc_vp_validate_action(c: &mut Criterion) {

let exec_ctx = IbcVpContext::new(ibc.ctx.pre());
let ctx = Rc::new(RefCell::new(exec_ctx));
let mut actions =
IbcActions::<_, parameters::Store<_>, token::Store<()>>::new(
ctx.clone(),
verifiers.clone(),
);
let mut actions = IbcActions::<
_,
parameters::Store<_>,
token::Store<_>,
token::ShieldedStore<_>,
>::new(ctx.clone(), verifiers.clone());
actions.set_validation_params(ibc.validation_params().unwrap());

let module = create_transfer_middlewares::<_, parameters::Store<_>>(
ctx.clone(),
verifiers,
);
let module = create_transfer_middlewares::<
_,
parameters::Store<_>,
token::Store<_>,
token::ShieldedStore<_>,
>(ctx.clone(), verifiers);
actions.add_transfer_module(module);
let module = NftTransferModule::<_, token::Store<()>>::new(ctx);
actions.add_transfer_module(module);
Expand Down Expand Up @@ -1791,12 +1806,13 @@ fn ibc_vp_execute_action(c: &mut Criterion) {
let gas_meter = RefCell::new(VpGasMeter::new_from_tx_meter(
&TxGasMeter::new(u64::MAX, 1),
));
let indexed_tx = IndexedTx::default();
let ibc = IbcVp::new(Ctx::new(
&Address::Internal(InternalAddress::Ibc),
&shell_read.state,
&signed_tx.tx,
&signed_tx.cmt,
&TxIndex(0),
&indexed_tx,
&gas_meter,
&keys_changed,
&verifiers,
Expand All @@ -1810,17 +1826,20 @@ fn ibc_vp_execute_action(c: &mut Criterion) {
let exec_ctx = IbcVpContext::new(ibc.ctx.pre());
let ctx = Rc::new(RefCell::new(exec_ctx));

let mut actions =
IbcActions::<_, parameters::Store<_>, token::Store<()>>::new(
ctx.clone(),
verifiers.clone(),
);
let mut actions = IbcActions::<
_,
parameters::Store<_>,
token::Store<_>,
token::ShieldedStore<_>,
>::new(ctx.clone(), verifiers.clone());
actions.set_validation_params(ibc.validation_params().unwrap());

let module = create_transfer_middlewares::<_, parameters::Store<_>>(
ctx.clone(),
verifiers,
);
let module = create_transfer_middlewares::<
_,
parameters::Store<_>,
token::Store<_>,
token::ShieldedStore<_>,
>(ctx.clone(), verifiers);
actions.add_transfer_module(module);
let module = NftTransferModule::<_, token::Store<()>>::new(ctx);
actions.add_transfer_module(module);
Expand Down
3 changes: 1 addition & 2 deletions crates/benches/process_wrapper.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use criterion::{Criterion, criterion_group, criterion_main};
use namada_apps_lib::key::RefTo;
use namada_apps_lib::state::TxIndex;
use namada_apps_lib::time::DateTimeUtc;
use namada_apps_lib::token::{Amount, DenominatedAmount, Transfer};
use namada_apps_lib::tx::Authorization;
Expand Down Expand Up @@ -90,7 +89,7 @@ fn process_tx(c: &mut Criterion) {
shell
.check_proposal_tx(
&wrapper,
&TxIndex::default(),
Default::default(),
validation_meta,
temp_state,
datetime,
Expand Down
Loading
Loading