Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 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
ff21d61
Keep track of nr of MASP IBC shieldings
sug0 Oct 21, 2025
918b545
Seed MASP note with IBC shielding counter
sug0 Oct 21, 2025
a0ee269
Integrate params store with IBC transfer ctx
sug0 Oct 21, 2025
c75f5f6
Add convenience method to compute MASP epoch
sug0 Oct 21, 2025
b3d6814
Expose storage predicate to check if a conversion exists
sug0 Oct 21, 2025
a1d2320
Attribute epochs to shielded IBC assets
sug0 Oct 21, 2025
215e197
Remove unused type
sug0 Oct 21, 2025
49f7be0
Relocate compact notes to core
sug0 Oct 21, 2025
876d784
Serde serialize compact notes
sug0 Oct 21, 2025
e10a95f
Add new type of MASP event for unencypted notes
sug0 Oct 21, 2025
38422fc
Make IBC ctx event emission generic
sug0 Oct 21, 2025
19dd5e5
Emit MASP shielding events from IBC ctx
sug0 Oct 21, 2025
285f4ac
Replace tx index with more generic indexed tx in protocol
sug0 Oct 22, 2025
87adc78
Store indexed tx in tx/vp ctx
sug0 Oct 22, 2025
6571a41
Repurpose `get_tx_index` host fn to retrieve indexed tx
sug0 Oct 22, 2025
c7be5c6
Create indexed tx from tuple
sug0 Oct 22, 2025
f76d429
Set proper tx index in IBC shielding MASP event
sug0 Oct 22, 2025
bdc6f1c
Add convenience method to get transp addr from IbcAccountId
sug0 Oct 22, 2025
8e91fbe
Replace matches with to_address
sug0 Oct 22, 2025
f046546
Activate MASP note minting via IBC
sug0 Oct 22, 2025
fa7c187
Revert "Delete unused test helper fn"
sug0 Oct 23, 2025
aa82256
Avoid overriding receiver in some IBC e2e tests
sug0 Oct 23, 2025
c751940
Test IBC transfers to and from payment addrs
sug0 Oct 23, 2025
715bdfb
Extend MASP events with IBC protocol shielding attrs
sug0 Oct 24, 2025
ac7fbcb
Tag IBC protocol shieldings
sug0 Oct 24, 2025
73d7759
Expose MASP tx extraction in SDK
sug0 Oct 27, 2025
2165570
Generate dummy MASP transactions from unencrypted notes
sug0 Oct 27, 2025
8c18463
Test dummy masp tx note trial decryption
sug0 Oct 27, 2025
57fe440
Add storage method to write MASP undated asset balance
sug0 Oct 27, 2025
f80bda9
Augment shielded token store with undated asset balance methods
sug0 Oct 27, 2025
2d2f80e
Increment undated asset balance in IBC shieldings
sug0 Oct 27, 2025
e7526bc
Fix frontend sus fee comments on sdk args
sug0 Oct 27, 2025
bc18cdd
Set payment addr as shielded refund target
sug0 Oct 27, 2025
a6e9a76
Test IBC shielded refunding
sug0 Oct 27, 2025
89d2847
Enable new IBC test in CI
sug0 Oct 27, 2025
aedadee
Receive shielded swaps into payment addr
sug0 Oct 28, 2025
adc28a1
Remove sus fee from shielded swaps args
sug0 Oct 28, 2025
6975621
Handle refunds on IBC ack errors and timeouts
sug0 Oct 30, 2025
2f12d8b
Allow IBC memoless shieldings in MASP VP
sug0 Oct 30, 2025
4f5190d
Refactor IBC shielding state updates
sug0 Oct 31, 2025
07ab1eb
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": 350,
"e2e::ibc_tests::frontend_sus_fee": 350,
"e2e::ibc_tests::ibc_transfers": 414,
"e2e::ibc_tests::ibc_nft_transfers": 224,
Expand Down
2 changes: 1 addition & 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
1 change: 1 addition & 0 deletions crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ ed25519-consensus.workspace = true
ethabi.workspace = true
ethbridge-structs.workspace = true
eyre.workspace = true
group.workspace = true
ibc.workspace = true
ics23.workspace = true
impl-num-traits.workspace = true
Expand Down
Loading
Loading