Skip to content

Commit

Permalink
Merge tag 'v0.28.1' into draft
Browse files Browse the repository at this point in the history
Namada 0.28.1 is a patch release that makes improvements to the MASP, SDK, merkle trees, and chain initialization conditions.

* tag 'v0.28.1':
  Namada 0.28.1
  added changelog
  [feat]: Use a backup lookup for pre-genesis wallet.toml files
  added changelog
  fix: makefile
  changelog: add #2263
  add changelog
  Initialize total minted token balances to zero
  added changelog
  finalize_block: fix removed tx changed storage keys
  fix pruning bp merkle tree
  fix: sdk async
  test/sdk/masp: update params tests
  changelog: #2272
  ledger: preload masp verifying keys on start-up
  cache MASP verifying keys in memory
  ci: install cargo about using cargo
  • Loading branch information
tzemanovic committed Dec 14, 2023
2 parents 57db046 + 468d3d3 commit 0c0ec51
Show file tree
Hide file tree
Showing 44 changed files with 254 additions and 156 deletions.
2 changes: 2 additions & 0 deletions .changelog/v0.28.1/bug-fixes/2261-fix-sdk-0.28.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fix sdk compilation when using async-send feature flag.
([\#2261](https://github.com/anoma/namada/pull/2261))
2 changes: 2 additions & 0 deletions .changelog/v0.28.1/bug-fixes/2263-fix-missing-changed-keys.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Added back missing changed storage keys in transaction results.
([\#2263](https://github.com/anoma/namada/pull/2263))
2 changes: 2 additions & 0 deletions .changelog/v0.28.1/bug-fixes/2264-fix-bp-tree-pruning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fix to skip pruning BridgePool Merkle trees when no signed nonce
([\#2264](https://github.com/anoma/namada/issues/2264))
2 changes: 2 additions & 0 deletions .changelog/v0.28.1/bug-fixes/2270-masp-rewards-fixes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Initialize token total supply to zero at init chain.
([\#2270](https://github.com/anoma/namada/pull/2270))
2 changes: 2 additions & 0 deletions .changelog/v0.28.1/improvements/2272-cache-masp-keys.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Preload and cache MASP verifying keys on ledger start-up.
([\#2272](https://github.com/anoma/namada/pull/2272))
2 changes: 2 additions & 0 deletions .changelog/v0.28.1/improvements/2273-pre-gen-wallet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Now join-network will try to look for non validator wallet in more places.
([\#2273](https://github.com/anoma/namada/pull/2273))
1 change: 1 addition & 0 deletions .changelog/v0.28.1/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Namada 0.28.1 is a patch release that makes improvements to the MASP, SDK, merkle trees, and chain initialization conditions.
7 changes: 1 addition & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,7 @@ jobs:
run: curl -k https://installer.heliax.click/EmbarkStudios/[email protected]! | bash
- name: Install cargo-about (only windows)
if: startsWith(runner.os, 'Windows')
run: |
curl -L https://github.com/EmbarkStudios/cargo-about/releases/download/0.5.7/cargo-about-0.5.7-x86_64-pc-windows-msvc.tar.gz -o cargo-about
echo "${GITHUB_WORKSPACE}" >> $env.GITHUB_PATH
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
GITHUB_WORKSPACE: ${{ github.workspace }}
run: cargo install --locked cargo-about
- name: ${{ matrix.make.name }}
run: make ${{ matrix.make.command }}
- name: Upload binaries package
Expand Down
27 changes: 22 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
# CHANGELOG

## v0.28.1

Namada 0.28.1 is a patch release that makes improvements to the MASP, SDK, merkle trees, and chain initialization conditions.

### BUG FIXES

- Fix sdk compilation when using async-send feature flag.
([\#2261](https://github.com/anoma/namada/pull/2261))
- Added back missing changed storage keys in transaction results.
([\#2263](https://github.com/anoma/namada/pull/2263))
- Fix to skip pruning BridgePool Merkle trees when no signed nonce
([\#2264](https://github.com/anoma/namada/issues/2264))
- Initialize token total supply to zero at init chain.
([\#2270](https://github.com/anoma/namada/pull/2270))

### IMPROVEMENTS

- Preload and cache MASP verifying keys on ledger start-up.
([\#2272](https://github.com/anoma/namada/pull/2272))
- Now join-network will try to look for non validator wallet in more places.
([\#2273](https://github.com/anoma/namada/pull/2273))

## v0.28.0

Namada 0.28.0 is a minor release that improves the genesis setup to allow signing with hardware wallet and contains various improvements including validator liveness jailing, accounts simplifications, bug fixes, stability improvements and more.
<!--
Add a summary for the release here.
If you don't change this message, or if this file is empty, the release
will not be created. -->

### BUG FIXES

Expand Down
29 changes: 15 additions & 14 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ keywords = ["blockchain", "privacy", "crypto", "protocol", "network"]
license = "GPL-3.0"
readme = "README.md"
repository = "https://github.com/anoma/namada"
version = "0.28.0"
version = "0.28.1"

[workspace.dependencies]
ark-bls12-381 = {version = "0.3"}
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ check-mainnet:
check-crates:
$(foreach p,$(crates), echo "Checking $(p)" && cargo +$(nightly) check -Z unstable-options --tests -p $(p) && ) \
make -C $(wasms_for_tests) check && \
cargo check --package namada --target wasm32-unknown-unknown --no-default-features --features "namada-sdk"
cargo check --package namada --target wasm32-unknown-unknown --no-default-features --features "namada-sdk" && \
cargo check --package namada_sdk --all-features

clippy-wasm = $(cargo) +$(nightly) clippy --manifest-path $(wasm)/Cargo.toml --all-targets -- -D warnings

Expand Down
17 changes: 13 additions & 4 deletions apps/src/lib/client/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,12 @@ pub async fn join_network(

// Pre-load the validator pre-genesis wallet and its keys to validate that
// everything is in place before downloading the network archive
let validator_alias_and_pre_genesis_wallet =
validator_alias_and_dir.map(|(validator_alias, pre_genesis_dir)| {
let validator_alias_and_pre_genesis_wallet = validator_alias_and_dir
.as_ref()
.map(|(validator_alias, pre_genesis_dir)| {
(
alias::Alias::from(validator_alias),
pre_genesis::load(&pre_genesis_dir).unwrap_or_else(|err| {
pre_genesis::load(pre_genesis_dir).unwrap_or_else(|err| {
eprintln!(
"Error loading validator pre-genesis wallet {err}",
);
Expand Down Expand Up @@ -262,7 +263,15 @@ pub async fn join_network(

// Try to load pre-genesis wallet, if any
let pre_genesis_wallet_path = base_dir.join(PRE_GENESIS_DIR);
let pre_genesis_wallet = crate::wallet::load(&pre_genesis_wallet_path);
let pre_genesis_wallet =
if let Some(wallet) = crate::wallet::load(&pre_genesis_wallet_path) {
Some(wallet)
} else {
validator_alias_and_dir
.as_ref()
.and_then(|(_, path)| crate::wallet::load(path))
};

// Derive wallet from genesis
let wallet = genesis.derive_wallet(
&chain_dir,
Expand Down
4 changes: 4 additions & 0 deletions apps/src/lib/node/ledger/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ async fn run_aux(config: config::Ledger, wasm_dir: PathBuf) {
}
};

tracing::info!("Loading MASP verifying keys.");
let _ = namada_sdk::masp::preload_verifying_keys();
tracing::info!("Done loading MASP verifying keys.");

// Start ABCI server and broadcaster (the latter only if we are a validator
// node)
let (abci, broadcaster, shell_handler) = start_abci_broadcaster_shell(
Expand Down
3 changes: 2 additions & 1 deletion apps/src/lib/node/ledger/shell/finalize_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,8 @@ where
tx_event["hash"],
result
);
changed_keys.append(&mut result.changed_keys);
changed_keys
.extend(result.changed_keys.iter().cloned());
stats.increment_successful_txs();
if let Some(wrapper) = embedding_wrapper {
self.commit_inner_tx_hash(wrapper);
Expand Down
10 changes: 2 additions & 8 deletions apps/src/lib/node/ledger/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,11 +591,8 @@ mod tests {
);
let new_epoch_start = BlockHeight(1);
let signed_root_key = bridge_pool::get_signed_root_key();
// the first nonce isn't written for a test skipping pruning
let nonce = Uint::default();
let root_proof =
BridgePoolRootProof::new((KeccakHash::default(), nonce));
let bytes = types::encode(&root_proof);
storage.write(&signed_root_key, bytes).unwrap();

storage
.begin_block(BlockHash::default(), new_epoch_start)
Expand All @@ -622,11 +619,8 @@ mod tests {
.write(&key, types::encode(&value))
.expect("write failed");

// the second nonce isn't written for a test skipping pruning
let nonce = nonce + 1;
let root_proof =
BridgePoolRootProof::new((KeccakHash::default(), nonce));
let bytes = types::encode(&root_proof);
storage.write(&signed_root_key, bytes).unwrap();

storage.block.epoch = storage.block.epoch.next();
storage.block.pred_epochs.new_epoch(new_epoch_start);
Expand Down
14 changes: 9 additions & 5 deletions apps/src/lib/node/ledger/storage/rocksdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1453,17 +1453,21 @@ impl DB for RocksDB {
&self,
height: BlockHeight,
last_height: BlockHeight,
) -> Result<Uint> {
) -> Result<Option<Uint>> {
let nonce_key = bridge_pool::get_signed_root_key();
let bytes = if height == BlockHeight(0) || height >= last_height {
self.read_subspace_val(&nonce_key)?
} else {
self.read_subspace_val_with_height(&nonce_key, height, last_height)?
};
let bytes = bytes.expect("Signed root should exist");
let bp_root_proof = BridgePoolRootProof::try_from_slice(&bytes)
.map_err(Error::BorshCodingError)?;
Ok(bp_root_proof.data.1)
match bytes {
Some(bytes) => {
let bp_root_proof = BridgePoolRootProof::try_from_slice(&bytes)
.map_err(Error::BorshCodingError)?;
Ok(Some(bp_root_proof.data.1))
}
None => Ok(None),
}
}

fn write_replay_protection_entry(
Expand Down
4 changes: 2 additions & 2 deletions core/src/ledger/storage/mockdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,8 @@ impl DB for MockDB {
&self,
_height: BlockHeight,
_last_height: BlockHeight,
) -> Result<Uint> {
Ok(Uint::default())
) -> Result<Option<Uint>> {
Ok(None)
}

fn write_replay_protection_entry(
Expand Down
Loading

0 comments on commit 0c0ec51

Please sign in to comment.