Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New genesis flow #2088

Merged
merged 49 commits into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
287de76
[feat] Re-implementing new genesis flow in v0.24
batconjurer Oct 26, 2023
f5312a5
fixup! [feat] Re-implementing new genesis flow in v0.24
tzemanovic Oct 26, 2023
741e9ea
[fix]: Compiling now. Tests need fixing
batconjurer Oct 27, 2023
430d82c
[fix]: Fixed unit tests
batconjurer Oct 30, 2023
24ec2df
More fixes
batconjurer Oct 30, 2023
fa976ca
[feat] Re-implementing new genesis flow in v0.24
batconjurer Oct 26, 2023
c045f5a
fixup! [feat] Re-implementing new genesis flow in v0.24
tzemanovic Oct 26, 2023
87c954d
[fix]: Compiling now. Tests need fixing
batconjurer Oct 27, 2023
790521d
[fix]: Fixed unit tests
batconjurer Oct 30, 2023
af55362
More fixes
batconjurer Oct 30, 2023
e6dd02d
fix `make check-crates`
brentstone Oct 31, 2023
0e04a92
fix fmt
brentstone Oct 31, 2023
3838cef
[fix]: Fix integration tests
batconjurer Nov 2, 2023
5356f55
[ci skip] specifiy aws region
Fraccaman Oct 30, 2023
b674b8b
wasm server download via env
Fraccaman Oct 27, 2023
ac77855
added changelog
Fraccaman Oct 27, 2023
4fe551f
improve sdk
Fraccaman Oct 27, 2023
d501475
remove vp/tx cache at startup
Fraccaman Oct 30, 2023
01c1231
apps: turn off rocksdb jemalloc on windows
tzemanovic Oct 25, 2023
d3be7e2
changelog: add #2047
tzemanovic Oct 25, 2023
3537ef7
test: remove dead multitoken_tests
tzemanovic Oct 23, 2023
755586b
Namada 0.24.1
batconjurer Nov 2, 2023
9241eee
[fix]: Compiling now. Tests need fixing
batconjurer Nov 2, 2023
46841a2
fix `make check-crates`
brentstone Oct 31, 2023
8f6cc6f
Merge branch 'bat/feat/new-genesis-CI' of github.com:anoma/namada int…
batconjurer Nov 2, 2023
1639cbb
merging in upstream changes from feature branch
batconjurer Nov 2, 2023
3a9d9da
[fix] Regenerated MASP integration test proofs
batconjurer Nov 2, 2023
78d3867
[fix]: Linting
batconjurer Nov 2, 2023
95ac1bb
[fix]: Fixed signer decoding for ibc
batconjurer Nov 2, 2023
96c2547
[fix]: Formatting
batconjurer Nov 2, 2023
29443a6
[fix]: Fixed benchmarks, e2e test ci scripts, masp conversion persist…
batconjurer Nov 3, 2023
c01d8b4
Merge branch 'main' into bat/feat/new-genesis
batconjurer Nov 3, 2023
4a30604
remove the rest of the "dev" feature usages
tzemanovic Nov 4, 2023
17af8a3
apps/genesis: change root dir detection
tzemanovic Nov 4, 2023
fb350be
bench: fix voting epochs to correspond to PoS params
tzemanovic Nov 4, 2023
e2edd62
genesis: use the default addresses for tests and benches
tzemanovic Nov 4, 2023
df47a3a
make: skip pos_state_machine_test in unit tests
tzemanovic Nov 4, 2023
718312a
bench: fix txs benches by writing a chain genesis config to FS
tzemanovic Nov 4, 2023
e8a08bd
rename `HexString::to_bytes` to `parse` and remove other unused methods
tzemanovic Nov 4, 2023
3769849
test+bench: use `defaults::validator_keypair` for genesis validator-0
tzemanovic Nov 5, 2023
1a4eb1c
genesis: fix import warn
tzemanovic Nov 5, 2023
8f4e4bc
allow to join-network with archive in a dir
tzemanovic Nov 5, 2023
f2a557c
deps: remove now unused file-serve
tzemanovic Nov 5, 2023
7f6e268
fix integration tests shell initialization
tzemanovic Nov 5, 2023
5569851
genesis: rm dbg!s
tzemanovic Nov 5, 2023
d9bc326
make: separate integration tests from units coverage
tzemanovic Nov 5, 2023
6ef52c1
wallet: don't crash when no wallet
tzemanovic Nov 5, 2023
cf00f26
make: fix test-coverage
tzemanovic Nov 5, 2023
2faf58e
changelog: add #2088
tzemanovic Nov 5, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ jobs:
/tmp/.*/e2e-test.*/setup/validator-*/.namada/logs/*.log
/tmp/.*/logs/*
/tmp/.*/setup/validator-*
/tmp/.*/setup/validator-*/*
/tmp/.*/setup/validator-*/*
retention-days: 5
- name: Print sccache stats
if: always()
Expand Down
48 changes: 12 additions & 36 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ eyre = "0.6.5"
fd-lock = "3.0.12"
ferveo = {git = "https://github.com/anoma/ferveo", rev = "e5abd0acc938da90140351a65a26472eb495ce4d"}
ferveo-common = {git = "https://github.com/anoma/ferveo", rev = "e5abd0acc938da90140351a65a26472eb495ce4d"}
file-serve = "0.2.0"
flate2 = "1.0.22"
fs_extra = "1.2.0"
futures = "0.3"
Expand Down
32 changes: 18 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ build-test:
$(cargo) +$(nightly) build --tests $(jobs)

build-release:
NAMADA_DEV=false $(cargo) build $(jobs) --release --timings --package namada_apps --manifest-path Cargo.toml
$(cargo) build $(jobs) --release --timings --package namada_apps --manifest-path Cargo.toml

build-debug:
NAMADA_DEV=false $(cargo) build --package namada_apps --manifest-path Cargo.toml
$(cargo) build --package namada_apps --manifest-path Cargo.toml

install-release:
NAMADA_DEV=false $(cargo) install --path ./apps --locked
$(cargo) install --path ./apps --locked

check-release:
NAMADA_DEV=false $(cargo) check --release --package namada_apps
$(cargo) check --release --package namada_apps

package: build-release
scripts/make-package.sh
Expand All @@ -88,7 +88,7 @@ check-crates:
clippy-wasm = $(cargo) +$(nightly) clippy --manifest-path $(wasm)/Cargo.toml --all-targets -- -D warnings

clippy:
NAMADA_DEV=false $(cargo) +$(nightly) clippy $(jobs) --all-targets -- -D warnings && \
$(cargo) +$(nightly) clippy $(jobs) --all-targets -- -D warnings && \
make -C $(wasms) clippy && \
make -C $(wasms_for_tests) clippy && \
$(foreach wasm,$(wasm_templates),$(clippy-wasm) && ) true
Expand All @@ -103,7 +103,7 @@ tendermint:
./scripts/get_tendermint.sh

install: cometbft
NAMADA_DEV=false $(cargo) install --path ./apps --locked
$(cargo) install --path ./apps --locked

cometbft:
./scripts/get_cometbft.sh
Expand All @@ -126,14 +126,18 @@ audit:
test: test-unit test-e2e test-wasm test-benches

test-coverage:
# Run integration tests with pre-built MASP proofs
NAMADA_MASP_TEST_SEED=$(NAMADA_MASP_TEST_SEED) \
NAMADA_MASP_TEST_PROOFS=load \
# Run integration tests separately because they require `integration`
# feature (and without coverage) and run them with pre-built MASP proofs
$(cargo) +$(nightly) llvm-cov --output-dir target \
--features namada/testing \
--html \
-- --skip e2e --skip pos_state_machine_test \
-Z unstable-options --report-time
-- --skip e2e --skip pos_state_machine_test --skip integration \
-Z unstable-options --report-time && \
NAMADA_MASP_TEST_SEED=$(NAMADA_MASP_TEST_SEED) \
NAMADA_MASP_TEST_PROOFS=load \
$(cargo) +$(nightly) test integration:: \
--features integration \
-- -Z unstable-options --report-time

# NOTE: `TEST_FILTER` is prepended with `e2e::`. Since filters in `cargo test`
# work with a substring search, TEST_FILTER only works if it contains a string
Expand Down Expand Up @@ -167,7 +171,7 @@ test-integration-save-proofs:
# Run integration tests without specifiying any pre-built MASP proofs option
test-integration-slow:
RUST_BACKTRACE=$(RUST_BACKTRACE) \
$(cargo) +$(nightly) test integration::$(TEST_FILTER) \
$(cargo) +$(nightly) test integration::$(TEST_FILTER) --features integration \
-Z unstable-options \
-- \
-Z unstable-options --report-time
Expand All @@ -176,7 +180,7 @@ test-unit:
$(cargo) +$(nightly) test \
$(TEST_FILTER) \
$(jobs) \
-- --skip e2e --skip integration \
-- --skip e2e --skip integration --skip pos_state_machine_test \
-Z unstable-options --report-time

test-unit-mainnet:
Expand All @@ -191,7 +195,7 @@ test-unit-debug:
$(debug-cargo) +$(nightly) test \
$(jobs) \
$(TEST_FILTER) \
-- --skip e2e --skip integration \
-- --skip e2e --skip integration --skip pos_state_machine_test \
--nocapture \
-Z unstable-options --report-time

Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ Guide.
```shell
# Build the provided validity predicate and transaction wasm modules
make build-wasm-scripts-docker

# Development (debug) build Namada, which includes a validator and some default
# accounts, whose keys and addresses are available in the wallet
NAMADA_DEV=true make
```

### Before submitting a PR, pls make sure to run the following
Expand Down
7 changes: 4 additions & 3 deletions apps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ default = ["std", "abciplus"]
mainnet = [
"namada/mainnet",
]
dev = ["namada/dev"]
std = ["ed25519-consensus/std", "rand/std", "rand_core/std", "namada/std", "namada_sdk/std"]
# for integration tests and test utilies
testing = ["dev", "namada_test_utils"]

testing = ["namada_test_utils"]
benches = ["testing", "namada_test_utils"]
integration = []
abciplus = [
"namada/abciplus",
"namada/tendermint-rpc",
Expand Down Expand Up @@ -111,6 +111,7 @@ num-rational.workspace = true
num-traits.workspace = true
once_cell.workspace = true
orion.workspace = true
pretty_assertions.workspace = true
prost-types.workspace = true
prost.workspace = true
rand_core.workspace = true
Expand Down
9 changes: 0 additions & 9 deletions apps/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,4 @@ fn main() {

// Tell Cargo that if the given file changes, to rerun this build script.
println!("cargo:rerun-if-changed={}", PROTO_SRC);

// Tell Cargo to build when the `NAMADA_DEV` env var changes
println!("cargo:rerun-if-env-changed=NAMADA_DEV");
// Enable "dev" feature if `NAMADA_DEV` is trueish
if let Ok(dev) = env::var("NAMADA_DEV") {
if dev.to_ascii_lowercase().trim() == "true" {
println!("cargo:rustc-cfg=feature=\"dev\"");
}
}
}
Empty file removed apps/src/bin/namada-client/cli.rs
Empty file.
33 changes: 19 additions & 14 deletions apps/src/bin/namada-node/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,31 @@ pub fn main() -> Result<()> {
match cmd {
cmds::NamadaNode::Ledger(sub) => match sub {
cmds::Ledger::Run(cmds::LedgerRun(args)) => {
let wasm_dir = ctx.wasm_dir();
let chain_ctx = ctx.take_chain_or_exit();
let wasm_dir = chain_ctx.wasm_dir();
sleep_until(args.start_time);
ledger::run(ctx.config.ledger, wasm_dir);
ledger::run(chain_ctx.config.ledger, wasm_dir);
}
cmds::Ledger::RunUntil(cmds::LedgerRunUntil(args)) => {
let wasm_dir = ctx.wasm_dir();
let mut chain_ctx = ctx.take_chain_or_exit();
let wasm_dir = chain_ctx.wasm_dir();
sleep_until(args.time);
ctx.config.ledger.shell.action_at_height =
chain_ctx.config.ledger.shell.action_at_height =
Some(args.action_at_height);
ledger::run(ctx.config.ledger, wasm_dir);
ledger::run(chain_ctx.config.ledger, wasm_dir);
}
cmds::Ledger::Reset(_) => {
ledger::reset(ctx.config.ledger)
let chain_ctx = ctx.take_chain_or_exit();
ledger::reset(chain_ctx.config.ledger)
.wrap_err("Failed to reset Namada node")?;
}
cmds::Ledger::DumpDb(cmds::LedgerDumpDb(args)) => {
ledger::dump_db(ctx.config.ledger, args);
let chain_ctx = ctx.take_chain_or_exit();
ledger::dump_db(chain_ctx.config.ledger, args);
}
cmds::Ledger::RollBack(_) => {
ledger::rollback(ctx.config.ledger)
let chain_ctx = ctx.take_chain_or_exit();
ledger::rollback(chain_ctx.config.ledger)
.wrap_err("Failed to rollback the Namada node")?;
}
},
Expand All @@ -39,18 +44,18 @@ pub fn main() -> Result<()> {
// In here, we just need to overwrite the default chain ID, in
// case it's been already set to a different value
if let Some(chain_id) = ctx.global_args.chain_id.as_ref() {
ctx.global_config.default_chain_id = chain_id.clone();
ctx.global_config.default_chain_id = Some(chain_id.clone());
ctx.global_config
.write(&ctx.global_args.base_dir)
.unwrap_or_else(|err| {
eprintln!("Error writing global config: {}", err);
eprintln!("Error writing global config: {err}");
cli::safe_exit(1)
});
tracing::debug!(
"Generated config and set default chain ID to \
{chain_id}"
);
}
tracing::debug!(
"Generated config and set default chain ID to {}",
&ctx.global_config.default_chain_id
);
}
},
}
Expand Down
2 changes: 1 addition & 1 deletion apps/src/bin/namada/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ fn handle_command(cmd: cli::cmds::Namada, raw_sub_cmd: String) -> Result<()> {
fn handle_subcommand(program: &str, mut sub_args: Vec<String>) -> Result<()> {
let env_vars = env::vars_os();

let cmd_name = if cfg!(feature = "dev") && env::var("CARGO").is_ok() {
let cmd_name = if env::var("CARGO").is_ok() {
// When the command is ran from inside `cargo run`, we also want to
// call the sub-command via `cargo run` to rebuild if necessary.
// We do this by prepending the arguments with `cargo run` arguments.
Expand Down
Loading
Loading