Skip to content

Commit

Permalink
[chore]: Merge in main
Browse files Browse the repository at this point in the history
  • Loading branch information
batconjurer committed Jul 27, 2023
2 parents cfb57ab + 7fdf079 commit 2329c2d
Show file tree
Hide file tree
Showing 57 changed files with 780 additions and 243 deletions.
2 changes: 2 additions & 0 deletions .changelog/v0.20.1/bug-fixes/1712-fix-check-crates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Ensure that each crate in the workspace can be built with default features.
([\#1712](https://github.com/anoma/namada/pull/1712))
2 changes: 2 additions & 0 deletions .changelog/v0.20.1/bug-fixes/1751-fix-balance-query.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fixed transparent balance query when only an owner address is specified without
an explicit token. ([\#1751](https://github.com/anoma/namada/pull/1751))
2 changes: 2 additions & 0 deletions .changelog/v0.20.1/bug-fixes/1756-pos-inflation-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fixes how PoS inflation is calculated.
([\#1756](https://github.com/anoma/namada/pull/1756))
2 changes: 2 additions & 0 deletions .changelog/v0.20.1/bug-fixes/1763-fix-dec-ord.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fixes the ordering for I256 type.
([\#1763](https://github.com/anoma/namada/pull/1763))
2 changes: 2 additions & 0 deletions .changelog/v0.20.1/improvements/1725-remove-native-vp-addr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Removed the associated type for an address from `trait NativeVp`.
([\#1725](https://github.com/anoma/namada/pull/1725))
1 change: 1 addition & 0 deletions .changelog/v0.20.1/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Namada 0.20.1 is a patch release addressing a bug in the inflation mechanism and minor ledger improvements.
23 changes: 19 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ jobs:
BUCKET_NAME: namada-wasm-master
AWS_REGION: eu-west-1

namada:
unit-and-integration-tests:
runs-on:
group: gians-runners
timeout-minutes: 80
Expand Down Expand Up @@ -238,6 +238,12 @@ jobs:
run: |
wget -q -O- https://github.com/rui314/mold/releases/download/v${{ matrix.mold_version }}/mold-${{ matrix.mold_version }}-x86_64-linux.tar.gz | tar -xz
mv mold-${{ matrix.mold_version }}-x86_64-linux/bin/mold /usr/local/bin
- name: Download MASP parameters
run: |
mkdir -p /home/runner/.masp-params
curl -o /home/runner/.masp-params/masp-spend.params -L https://github.com/anoma/masp-mpc/releases/download/namada-trusted-setup/masp-spend.params\?raw\=true
curl -o /home/runner/.masp-params/masp-output.params -L https://github.com/anoma/masp-mpc/releases/download/namada-trusted-setup/masp-output.params?raw=true
curl -o /home/runner/.masp-params/masp-convert.params -L https://github.com/anoma/masp-mpc/releases/download/namada-trusted-setup/masp-convert.params?raw=true
- name: Download wasm artifacts
uses: actions/download-artifact@v3
with:
Expand All @@ -246,9 +252,10 @@ jobs:
- uses: taiki-e/install-action@cargo-llvm-cov
- name: Check crates build with default features
run: make check-crates
- name: Run unit test
run: make test-unit-coverage${{ matrix.make.suffix }}
- name: Run unit and integration tests
run: make test-coverage${{ matrix.make.suffix }}
env:
NAMADA_MASP_PARAMS_DIR: /home/runner/.masp-params
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"
- name: Upload coverage
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -386,6 +393,7 @@ jobs:
os: [ubuntu-20.04]
nightly_version: [nightly-2023-06-01]
mold_version: [1.7.0]
comet_bft: [0.37.2]
make:
- name: e2e
suffix: ''
Expand Down Expand Up @@ -488,6 +496,12 @@ jobs:
run: make build-test
env:
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"
- name: Download MASP parameters
run: |
mkdir -p /home/runner/.masp-params
curl -o /home/runner/.masp-params/masp-spend.params -L https://github.com/anoma/masp-mpc/releases/download/namada-trusted-setup/masp-spend.params\?raw\=true
curl -o /home/runner/.masp-params/masp-output.params -L https://github.com/anoma/masp-mpc/releases/download/namada-trusted-setup/masp-output.params?raw=true
curl -o /home/runner/.masp-params/masp-convert.params -L https://github.com/anoma/masp-mpc/releases/download/namada-trusted-setup/masp-convert.params?raw=true
- name: Wait for release binaries
uses: lewagon/[email protected]
with:
Expand All @@ -508,7 +522,7 @@ jobs:
path: ./target/release/
- name: Download CometBFT
run: |
curl -o cometbft.tar.gz -LO https://github.com/cometbft/cometbft/releases/download/v0.37.2/cometbft_0.37.2_linux_amd64.tar.gz
curl -o cometbft.tar.gz -LO https://github.com/cometbft/cometbft/releases/download/v${{ matrix.comet_bft }}/cometbft_${{ matrix.comet_bft }}_linux_amd64.tar.gz
tar -xvzf cometbft.tar.gz
mv cometbft /usr/local/bin
- name: Change permissions
Expand All @@ -522,6 +536,7 @@ jobs:
run: |
python3 .github/workflows/scripts/schedule-e2e.py
env:
NAMADA_MASP_PARAMS_DIR: /home/runner/.masp-params
NAMADA_E2E_USE_PREBUILT_BINARIES: "true"
NAMADA_E2E_KEEP_TEMP: "true"
NAMADA_TM_STDOUT: "false"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
if: matrix.os == 'ubuntu-20.04'
env:
LINK: https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION: v0.3.0
SCCACHE_VERSION: v0.5.4
run: |
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl
mkdir -p $HOME/.local/bin
Expand Down Expand Up @@ -168,7 +168,7 @@ jobs:
if: matrix.os == 'ubuntu-20.04'
env:
LINK: https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION: v0.3.0
SCCACHE_VERSION: v0.5.4
run: |
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl
mkdir -p $HOME/.local/bin
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
if: matrix.os == 'ubuntu-20.04'
env:
LINK: https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION: v0.3.0
SCCACHE_VERSION: v0.5.4
run: |
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl
mkdir -p $HOME/.local/bin
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/scripts/e2e.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
"e2e::ledger_tests::invalid_transactions": 13,
"e2e::ledger_tests::ledger_many_txs_in_a_block": 55,
"e2e::ledger_tests::ledger_txs_and_queries": 30,
"e2e::ledger_tests::masp_incentives": 618,
"e2e::ledger_tests::masp_pinned_txs": 75,
"e2e::ledger_tests::masp_txs_and_queries": 282,
"e2e::ledger_tests::masp_txs_and_queries": 82,
"e2e::ledger_tests::pos_bonds": 77,
"e2e::ledger_tests::pos_init_validator": 40,
"e2e::ledger_tests::proposal_offline": 21,
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# CHANGELOG

## v0.20.1

Namada 0.20.1 is a patch release addressing a bug in the inflation mechanism and minor ledger improvements.

### BUG FIXES

- Ensure that each crate in the workspace can be built with default features.
([\#1712](https://github.com/anoma/namada/pull/1712))
- Fixed transparent balance query when only an owner address is specified without
an explicit token. ([\#1751](https://github.com/anoma/namada/pull/1751))
- Fixes how PoS inflation is calculated.
([\#1756](https://github.com/anoma/namada/pull/1756))
- Fixes the ordering for I256 type.
([\#1763](https://github.com/anoma/namada/pull/1763))

### IMPROVEMENTS

- Removed the associated type for an address from `trait NativeVp`.
([\#1725](https://github.com/anoma/namada/pull/1725))

## v0.20.0

Namada 0.20.0 is a minor releasing addressing several improvements to the PoS system and the ledger
Expand Down
24 changes: 12 additions & 12 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 @@ -31,7 +31,7 @@ keywords = ["blockchain", "privacy", "crypto", "protocol", "network"]
license = "GPL-3.0"
readme = "README.md"
repository = "https://github.com/anoma/namada"
version = "0.20.0"
version = "0.20.1"

[workspace.dependencies]
ark-bls12-381 = {version = "0.3"}
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ check-mainnet:

# Check that every crate can be built with default features
check-crates:
$(foreach p,$(crates), echo "Checking $(p)"; cargo +$(nightly) check -Z unstable-options --tests -p $(p) && ) true
$(foreach p,$(crates), echo "Checking $(p)" && cargo +$(nightly) check -Z unstable-options --tests -p $(p) && ) \
make -C $(wasms_for_tests) check

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

Expand Down Expand Up @@ -115,7 +116,8 @@ audit:

test: test-unit test-e2e test-wasm

test-unit-coverage:
# Unit tests with coverage report
test-coverage:
$(cargo) +$(nightly) llvm-cov --output-dir target \
--features namada/testing \
--html \
Expand Down
28 changes: 0 additions & 28 deletions apps/src/lib/cli/context.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
//! CLI input types can be used for command arguments
use std::collections::{HashMap, HashSet};
use std::env;
use std::marker::PhantomData;
use std::path::{Path, PathBuf};
use std::str::FromStr;

use color_eyre::eyre::Result;
use namada::ledger::masp::ShieldedContext;
use namada::ledger::wallet::store::AddressVpType;
use namada::ledger::wallet::Wallet;
use namada::types::address::Address;
use namada::types::chain::ChainId;
Expand Down Expand Up @@ -194,32 +192,6 @@ impl Context {
pub fn read_wasm(&self, file_name: impl AsRef<Path>) -> Vec<u8> {
wasm_loader::read_wasm_or_exit(self.wasm_dir(), file_name)
}

/// Try to find an alias for a given address from the wallet. If not found,
/// formats the address into a string.
pub fn lookup_alias(&self, addr: &Address) -> String {
match self.wallet.find_alias(addr) {
Some(alias) => alias.to_string(),
None => addr.to_string(),
}
}

/// Get addresses with tokens VP type.
pub fn tokens(&self) -> HashSet<Address> {
self.wallet.get_addresses_with_vp_type(AddressVpType::Token)
}

/// Get addresses with tokens VP type associated with their aliases.
pub fn tokens_with_aliases(&self) -> HashMap<Address, String> {
self.wallet
.get_addresses_with_vp_type(AddressVpType::Token)
.into_iter()
.map(|addr| {
let alias = self.lookup_alias(&addr);
(addr, alias)
})
.collect()
}
}

/// Load global config from expected path in the `base_dir` or try to generate a
Expand Down
Loading

0 comments on commit 2329c2d

Please sign in to comment.