Skip to content

Commit 914da00

Browse files
committed
Sync with 0.12.1
* maint-0.12: Namada 0.12.1 changelog: add #942 vp_verify_masp: avoid panicking unwrap()s
2 parents 89a01c7 + 6920cbc commit 914da00

31 files changed

+87
-69
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Avoid panicking unwrap()s in vp_verify_masp, to prevent crashing the node on
2+
malformed transactions. ([#942](https://github.com/anoma/namada/pull/942))

.changelog/v0.12.1/summary.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Namada 0.12.1 is a hotfix release, fixing a node crash on malformed
2+
transactions to the MASP.

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# CHANGELOG
22

3+
## v0.12.1
4+
5+
Namada 0.12.1 is a hotfix release, fixing a node crash on malformed
6+
transactions to the MASP.
7+
8+
### BUG FIXES
9+
10+
- Avoid panicking unwrap()s in vp_verify_masp, to prevent crashing the node on
11+
malformed transactions. ([#942](https://github.com/anoma/namada/pull/942))
12+
313
## v0.12.0
414

515
Namada 0.12.0 is a scheduled minor release.

Cargo.lock

+10-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ license = "GPL-3.0"
66
name = "namada_apps"
77
readme = "../README.md"
88
resolver = "2"
9-
version = "0.12.0"
9+
version = "0.12.1"
1010
default-run = "namada"
1111

1212
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

core/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ edition = "2021"
44
license = "GPL-3.0"
55
name = "namada_core"
66
resolver = "2"
7-
version = "0.12.0"
7+
version = "0.12.1"
88

99
[features]
1010
default = []

encoding_spec/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ license = "GPL-3.0"
66
name = "namada_encoding_spec"
77
readme = "../README.md"
88
resolver = "2"
9-
version = "0.12.0"
9+
version = "0.12.1"
1010

1111
[features]
1212
default = ["abciplus"]

macros/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ edition = "2021"
44
license = "GPL-3.0"
55
name = "namada_macros"
66
resolver = "2"
7-
version = "0.12.0"
7+
version = "0.12.1"
88

99
[lib]
1010
proc-macro = true

proof_of_stake/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ license = "GPL-3.0"
66
name = "namada_proof_of_stake"
77
readme = "../README.md"
88
resolver = "2"
9-
version = "0.12.0"
9+
version = "0.12.1"
1010

1111
[features]
1212
default = ["abciplus"]

shared/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ edition = "2021"
44
license = "GPL-3.0"
55
name = "namada"
66
resolver = "2"
7-
version = "0.12.0"
7+
version = "0.12.1"
88

99
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1010

shared/src/vm/host_env.rs

+12-8
Original file line numberDiff line numberDiff line change
@@ -1822,22 +1822,26 @@ where
18221822
EVAL: VpEvaluator,
18231823
CA: WasmCacheAccess,
18241824
{
1825-
use masp_primitives::transaction::Transaction;
1826-
18271825
use crate::types::token::Transfer;
1826+
18281827
let gas_meter = unsafe { env.ctx.gas_meter.get() };
18291828
let (tx_bytes, gas) = env
18301829
.memory
18311830
.read_bytes(tx_ptr, tx_len as _)
18321831
.map_err(|e| vp_host_fns::RuntimeError::MemoryError(Box::new(e)))?;
18331832
vp_host_fns::add_gas(gas_meter, gas)?;
1833+
18341834
let full_tx: Transfer =
1835-
BorshDeserialize::try_from_slice(tx_bytes.as_slice()).unwrap();
1836-
let shielded_tx: Transaction = full_tx.shielded.unwrap();
1837-
Ok(HostEnvResult::from(crate::ledger::masp::verify_shielded_tx(
1838-
&shielded_tx,
1839-
))
1840-
.to_i64())
1835+
BorshDeserialize::try_from_slice(tx_bytes.as_slice())
1836+
.map_err(vp_host_fns::RuntimeError::EncodingError)?;
1837+
1838+
match full_tx.shielded {
1839+
Some(shielded_tx) => Ok(HostEnvResult::from(
1840+
crate::ledger::masp::verify_shielded_tx(&shielded_tx),
1841+
)
1842+
.to_i64()),
1843+
None => Ok(HostEnvResult::Fail.to_i64()),
1844+
}
18411845
}
18421846

18431847
/// Log a string from exposed to the wasm VM Tx environment. The message will be

tests/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55
license = "GPL-3.0"
66
name = "namada_tests"
77
resolver = "2"
8-
version = "0.12.0"
8+
version = "0.12.1"
99

1010
[features]
1111
default = ["abciplus", "wasm-runtime"]

tx_prelude/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ edition = "2021"
44
license = "GPL-3.0"
55
name = "namada_tx_prelude"
66
resolver = "2"
7-
version = "0.12.0"
7+
version = "0.12.1"
88

99
[features]
1010
default = ["abciplus"]

vm_env/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ edition = "2021"
44
license = "GPL-3.0"
55
name = "namada_vm_env"
66
resolver = "2"
7-
version = "0.12.0"
7+
version = "0.12.1"
88

99
[features]
1010
default = ["abciplus"]

vp_prelude/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ edition = "2021"
44
license = "GPL-3.0"
55
name = "namada_vp_prelude"
66
resolver = "2"
7-
version = "0.12.0"
7+
version = "0.12.1"
88

99
[features]
1010
default = ["abciplus"]

wasm/Cargo.lock

+11-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wasm/checksums.json

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
2-
"tx_bond.wasm": "tx_bond.be9c75f96b3b4880b7934d42ee218582b6304f6326a4588d1e6ac1ea4cc61c49.wasm",
3-
"tx_change_validator_commission.wasm": "tx_change_validator_commission.cd861e0e82f4934be6d8382d6fff98286b4fadbc20ab826b9e817f6666021273.wasm",
4-
"tx_ibc.wasm": "tx_ibc.13daeb0c88abba264d3052129eda0713bcf1a71f6f69bf37ec2494d0d9119f1f.wasm",
5-
"tx_init_account.wasm": "tx_init_account.e21cfd7e96802f8e841613fb89f1571451401d002a159c5e9586855ac1374df5.wasm",
6-
"tx_init_proposal.wasm": "tx_init_proposal.b9a77bc9e416f33f1e715f25696ae41582e1b379422f7a643549884e0c73e9de.wasm",
7-
"tx_init_validator.wasm": "tx_init_validator.1e9732873861c625f239e74245f8c504a57359c06614ba40387a71811ca4a097.wasm",
8-
"tx_reveal_pk.wasm": "tx_reveal_pk.47bc922a8be5571620a647ae442a1af7d03d05d29bef95f0b32cdfe00b11fee9.wasm",
9-
"tx_transfer.wasm": "tx_transfer.bbd1ef5d9461c78f0288986de046baad77e10671addc5edaf3c68ea1ae4ecc99.wasm",
10-
"tx_unbond.wasm": "tx_unbond.c0a690d0ad43a94294a6405bae3327f638a657446c74dc61dbb3a4d2ce488b5e.wasm",
2+
"tx_bond.wasm": "tx_bond.c80510dae9aa8785a33301a16747b358da20cb125edae01e330eba2153ca28f4.wasm",
3+
"tx_change_validator_commission.wasm": "tx_change_validator_commission.655b344c2d9cc602f9250cf390112ff2c9293537cdc1eb4a52c58ee622ccb538.wasm",
4+
"tx_ibc.wasm": "tx_ibc.de66b4cc33061f503c63964debda8061ab9e0f1294e6c5c510d4b94a409a2edf.wasm",
5+
"tx_init_account.wasm": "tx_init_account.87940d07eac068e03cfe5cd8b491032b3f1814d36060cbc761beb528f1c27b46.wasm",
6+
"tx_init_proposal.wasm": "tx_init_proposal.2464b3de1c3aa4ed25cf592366df3b744ec3d2030ce952ea18f38066d4091693.wasm",
7+
"tx_init_validator.wasm": "tx_init_validator.6a27ed0de01ab555628129ac9f05801d5ac812824633bd36e43b1d67b6360db6.wasm",
8+
"tx_reveal_pk.wasm": "tx_reveal_pk.d22e9b3310bad29fea038b42b4120f12b11ffe0ec4012ddf2d709aed490cac97.wasm",
9+
"tx_transfer.wasm": "tx_transfer.3f6d8d0c103bd631c7cd12b58663e026aa9743f8552b14919a1b5bcd9fd31741.wasm",
10+
"tx_unbond.wasm": "tx_unbond.6b801584c4d01f7b52988e5ecf971050e1575f1e15f818f3e2694604b402ebd8.wasm",
1111
"tx_update_vp.wasm": "tx_update_vp.ee2e9b882c4accadf4626e87d801c9ac8ea8c61ccea677e0532fc6c1ee7db6a2.wasm",
12-
"tx_vote_proposal.wasm": "tx_vote_proposal.263fd9f4cb40f283756f394d86bdea3417e9ecd0568d6582c07a5b6bd14287d6.wasm",
13-
"tx_withdraw.wasm": "tx_withdraw.6ce8faf6a32340178ddeaeb91a9b40e7f0433334e5c1f357964bf8e11d0077f1.wasm",
14-
"vp_implicit.wasm": "vp_implicit.17f5c2af947ccfadce22d0fffecde1a1b4bc4ca3acd5dd8b459c3dce4afcb4e8.wasm",
15-
"vp_masp.wasm": "vp_masp.5620cb6e555161641337d308851c760fbab4f9d3693cfd378703aa55e285249d.wasm",
16-
"vp_testnet_faucet.wasm": "vp_testnet_faucet.362584b063cc4aaf8b72af0ed8af8d05a179ebefec596b6ab65e0ca255ec3c80.wasm",
17-
"vp_token.wasm": "vp_token.a289723dd182fe0206e6c4cf1f426a6100787b20e2653d2fad6031e8106157f3.wasm",
18-
"vp_user.wasm": "vp_user.b83b2d0616bb2244c8a92021665a0be749282a53fe1c493e98c330a6ed983833.wasm",
19-
"vp_validator.wasm": "vp_validator.59e3e7729e14eeacc17d76b736d1760d59a1a6e9d6acbc9a870e1835438f524a.wasm"
12+
"tx_vote_proposal.wasm": "tx_vote_proposal.37269505f1526de9680b619413478a071ed2f92b22924e6fbb3b7127f88da41a.wasm",
13+
"tx_withdraw.wasm": "tx_withdraw.e5affdbd26cdd08aff6dfc37c5b3d92a8784547e28d039b863a6a95d5ac1cc97.wasm",
14+
"vp_implicit.wasm": "vp_implicit.2f0b200b9e0f3db5151e0b86f5e66ae1b7e43e01d8cdc852db1337c744fac4b6.wasm",
15+
"vp_masp.wasm": "vp_masp.da15ab8670750f400fc12616921dc3c959386bdb5d2df4f455f2299847c257ee.wasm",
16+
"vp_testnet_faucet.wasm": "vp_testnet_faucet.13f1911794bc69e4d7dcebd30b048740398b5d45f7efee95a07a627b1a46fa47.wasm",
17+
"vp_token.wasm": "vp_token.497a346ebcc1b7e7b844a8aab644a8d43ab9399006a95c7ca411035b8966b05e.wasm",
18+
"vp_user.wasm": "vp_user.59c397bd2356d01cea5379de64882423cf1e2bb361301651573c1e3619d43551.wasm",
19+
"vp_validator.wasm": "vp_validator.0b13e2f48407640ca35414c5b855f3e20f3393f60ff987aaa3b0febbb0d64e51.wasm"
2020
}

wasm/tx_template/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ edition = "2021"
44
license = "GPL-3.0"
55
name = "tx_template"
66
resolver = "2"
7-
version = "0.12.0"
7+
version = "0.12.1"
88

99
[lib]
1010
crate-type = ["cdylib"]

wasm/vp_template/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ edition = "2021"
44
license = "GPL-3.0"
55
name = "vp_template"
66
resolver = "2"
7-
version = "0.12.0"
7+
version = "0.12.1"
88

99
[lib]
1010
crate-type = ["cdylib"]

0 commit comments

Comments
 (0)