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

fix tx bond test condition #590

Merged
merged 4 commits into from Oct 14, 2022
Merged

Conversation

tzemanovic
Copy link
Member

@tzemanovic tzemanovic commented Oct 13, 2022

fixes issue spotted here: https://github.com/anoma/namada/actions/runs/3241666911/jobs/5313917717

The problem was that the delegation detection didn't check for equality on the source and validator addresses, which is what is produced from this seed (1ec12c4):

input: ... Bond { 
    validator: Established: atest1v4ehgw36xgunxvj9xqmny3jyxycnzdzxxqeng33ngvunqsfsx5mnwdfjgvenvwfk89prwdpjd0cjrk,
  source: Some(Established: atest1v4ehgw36xgunxvj9xqmny3jyxycnzdzxxqeng33ngvunqsfsx5mnwdfjgvenvwfk89prwdpjd0cjrk), 
  amount: Amount { micro: 0 } 
})

This is a false negative from a test so I think we can skip devnet for this change

@tzemanovic tzemanovic marked this pull request as ready for review October 13, 2022 13:28
.expect("Genesis validator should already have self-bond");
assert_eq!(
bond.pos_deltas, expected_bond,
"Delegation before pipeline offset should be equal to the \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change assert failure message away from "Delegation" (perhaps "Self-bond")?

let bond: Bond<token::Amount> = bonds_post.get(epoch).unwrap();
assert_eq!(
bond.pos_deltas, expected_bond,
"Delegation at and after pipeline offset should contain \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above regarding "Delegation"

Copy link
Contributor

@brentstone brentstone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only requested changes to some messages on assert failures, otherwise LGTM

Copy link
Contributor

@brentstone brentstone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tzemanovic tzemanovic merged commit 94367d5 into main Oct 14, 2022
@tzemanovic tzemanovic deleted the tomas/fix-tx-bond-test-condition branch October 14, 2022 08:34
james-chf added a commit that referenced this pull request Oct 27, 2022
* base/v0.8.1: (429 commits)
  Namada 0.8.1
  changelog: add #510
  [feat]: Make process proposal stateless
  test/e2e: fix node_connectivity test
  test/e2e: update expected string for non-validator node
  [fix]: Removed unnecessary patches in wasm
  [feat]: Patched tendermint-rs and ibc-rs to compatible versions
  app: set "namada" set default bin for `cargo run`
  fix: rename anoma to namada, remove author print
  CI: add workaround for release build missing git tag
  Namada 0.8.0
  changelog: add #547
  wasm: update checksums
  [chore]: Lints and formatting
  [fix]: Fixed proof specs for non-existence proofs
  [fix]: Update the main tree when deleting a key
  [fix]: Fixed last ibc unit test
  [fix]: Fixed some tests.
  [feat]: Refactored the merkle tree into a more maintainable multi-store
  build: pin abciplus library revisions
  wasm: update checksums.json
  ci: standardize on one tendermint hash
  formatting changes
  change `L_{NAM}` -> `L_{PoS}` for clarity and consistency
  change inflation `I` to have units of tokens per epoch
  fix term ordering in error calculation
  Remove other `:=` in favor of `=`
  distinguish new and old inflation rates with a prime
  fix md rendering
  correct the shielded pool error calculation
  change storing of error to storing of token ratios (same procedure)
  fix: `I` is percent per annum
  distinguish between `K` in storage and `K` as intermediate value in inflation calculation
  Use `I` for inflation rates, as `R` reserved for locked ratios
  specify some default values, other small edits
  release: add scripts/release.sh
  release: add release.toml to wasm workspace and wasm_for_tests
  release: don't tag from cargo release
  release: update release.toml for cargo-release 0.21.4
  wasm: remove tx_from_intent build
  wasm: repair wasm checksums
  Add changelog
  Add changelog
  Fix TransactionGasExceededed typo
  changelog: add #594
  shared/storage: fix the height recorded for a new epoch
  Apply suggestions from code review
  changelog: add #590
  wasm/tx_bond: fix delegation detection to compare source and validator
  wasm/tx_bond: add test seed which makes it fail
  Adds missing excape chars
  fix: governance docs latex
  ci: upload docs after build
  move unreleased changelogs accidentally added to v0.7.1
  Update .gitignore
  Add install-release target
  Update shared/src/ledger/ibc/handler.rs
  ci: added tendermint ad825dcadbd4b98c3f91ce5a711e4fb36a69c377
  [fix]: Fixed some array concatenations
  Update shared/src/ledger/ibc/handler.rs
  ci: fix build-and-test.yml
  ci: update wasm version
  ci: added gh action specific to eth-bridge-integration branch
  [feat]: Moved to ics23 v0.7.0. This came with some ibc updates as well
  Update README.md
  minor edits, ensuring consistency of terms
  updated the front page of docs
  added the right favicon
  ci: added slack secret
  changelog: add #452
  feat: rocksdb use jemalloc
  feat: update rocksdb version
  [ci] wasm checksums update
  changelog: add #501
  fix e2e tests
  fix e2e tests
  Misc refactoring
  Uses `end_epoch` in `query_proposal_result`
  Refactors governance e2e tests
  [ci] wasm checksums update
  changelog: #503
  [ci] wasm checksums update
  remove unfinished lazy_set, lazy_hashset and lazy_hashmap for now
  ledger/storage/lazy: update lazy_set for updated trait LazyCollection
  Fixes specs
  [ci] wasm checksums update
  fix display proposal result in cli
  fix proposal_submission e2e test
  [misc] rebase
  ledger/storage/lazy: remove unused error cases
  WIP: Nested LazyMap validation and testing
  WIP: validation for lazy_map
  WIP: StateMachine tests for lazy_vec validation
  update wasm checksums
  changelog: add #500
  remove intent gossiper, matchmaker and their deps
  Adds `max_proposal_period` governance parameter
  Removes `max_proposal_fund_transfer` parameter
  Use proposal `end_epoch` instead of `start_epoch` for voting power
  Skip tx whitelist for proposal code
  ...

# Conflicts:
#	.changelog/v0.8.0/bug-fixes/1249-fix-shell-last-epoch.md
#	.changelog/v0.8.0/bug-fixes/384-fix-new-epoch-start-height.md
#	.changelog/v0.8.0/improvements/1231-refactor-ledger-run-with-cleanup.md
#	.github/workflows/build-tendermint.yml
#	Cargo.lock
#	Makefile
#	apps/Cargo.toml
#	apps/src/lib/cli.rs
#	apps/src/lib/client/gossip.rs
#	apps/src/lib/client/mod.rs
#	apps/src/lib/client/rpc.rs
#	apps/src/lib/client/tendermint_rpc_types.rs
#	apps/src/lib/client/tendermint_websocket_client.rs
#	apps/src/lib/client/tx.rs
#	apps/src/lib/client/utils.rs
#	apps/src/lib/config/genesis.rs
#	apps/src/lib/config/mod.rs
#	apps/src/lib/node/ledger/mod.rs
#	apps/src/lib/node/ledger/protocol/mod.rs
#	apps/src/lib/node/ledger/rpc.rs
#	apps/src/lib/node/ledger/shell/finalize_block.rs
#	apps/src/lib/node/ledger/shell/init_chain.rs
#	apps/src/lib/node/ledger/shell/mod.rs
#	apps/src/lib/node/ledger/shell/prepare_proposal.rs
#	apps/src/lib/node/ledger/shell/process_proposal.rs
#	apps/src/lib/node/ledger/shell/queries.rs
#	apps/src/lib/node/ledger/shims/abcipp_shim.rs
#	apps/src/lib/node/ledger/shims/abcipp_shim_types.rs
#	apps/src/lib/node/ledger/storage/mod.rs
#	apps/src/lib/node/ledger/tendermint_node.rs
#	apps/src/lib/node/matchmaker.rs
#	proof_of_stake/src/lib.rs
#	proof_of_stake/src/types.rs
#	shared/Cargo.toml
#	shared/src/ledger/governance/vp.rs
#	shared/src/ledger/ibc/handler.rs
#	shared/src/ledger/ibc/vp/channel.rs
#	shared/src/ledger/ibc/vp/client.rs
#	shared/src/ledger/ibc/vp/connection.rs
#	shared/src/ledger/ibc/vp/mod.rs
#	shared/src/ledger/ibc/vp/port.rs
#	shared/src/ledger/ibc/vp/token.rs
#	shared/src/ledger/native_vp.rs
#	shared/src/ledger/pos/mod.rs
#	shared/src/ledger/pos/vp.rs
#	shared/src/ledger/storage/merkle_tree.rs
#	shared/src/ledger/storage/mod.rs
#	shared/src/ledger/storage/traits.rs
#	shared/src/ledger/treasury/mod.rs
#	shared/src/ledger/treasury/parameters.rs
#	shared/src/proto/mod.rs
#	shared/src/proto/types.rs
#	shared/src/types/hash.rs
#	shared/src/types/intent.rs
#	shared/src/types/key/common.rs
#	shared/src/types/key/mod.rs
#	shared/src/types/key/secp256k1.rs
#	shared/src/types/storage.rs
#	shared/src/vm/wasm/host_env.rs
#	tests/Cargo.toml
#	tests/src/e2e/ledger_tests.rs
#	tests/src/native_vp/mod.rs
#	tests/src/native_vp/pos.rs
#	tests/src/vm_host_env/ibc.rs
#	tests/src/vm_host_env/mod.rs
#	vm_env/Cargo.toml
#	vm_env/src/governance.rs
#	vm_env/src/ibc.rs
#	vm_env/src/lib.rs
#	vm_env/src/proof_of_stake.rs
#	vm_env/src/token.rs
#	wasm/Cargo.lock
#	wasm/checksums.json
#	wasm/tx_template/Cargo.toml
#	wasm/vp_template/Cargo.lock
#	wasm/vp_template/Cargo.toml
#	wasm/wasm_source/Cargo.lock
#	wasm/wasm_source/Cargo.toml
#	wasm/wasm_source/Makefile
#	wasm/wasm_source/src/tx_from_intent.rs
#	wasm/wasm_source/src/tx_transfer.rs
#	wasm/wasm_source/src/vp_testnet_faucet.rs
#	wasm/wasm_source/src/vp_user.rs
#	wasm_for_tests/tx_mint_tokens.wasm
#	wasm_for_tests/wasm_source/Cargo.lock
#	wasm_for_tests/wasm_source/Cargo.toml
juped added a commit that referenced this pull request Oct 27, 2022
Namada 0.8.1

* tag 'v0.8.1': (197 commits)
  Namada 0.8.1
  changelog: add #510
  [feat]: Make process proposal stateless
  test/e2e: fix node_connectivity test
  test/e2e: update expected string for non-validator node
  [fix]: Removed unnecessary patches in wasm
  [feat]: Patched tendermint-rs and ibc-rs to compatible versions
  app: set "namada" set default bin for `cargo run`
  fix: rename anoma to namada, remove author print
  CI: add workaround for release build missing git tag
  Namada 0.8.0
  changelog: add #547
  wasm: update checksums
  [chore]: Lints and formatting
  [fix]: Fixed proof specs for non-existence proofs
  [fix]: Update the main tree when deleting a key
  [fix]: Fixed last ibc unit test
  [fix]: Fixed some tests.
  [feat]: Refactored the merkle tree into a more maintainable multi-store
  build: pin abciplus library revisions
  wasm: update checksums.json
  ci: standardize on one tendermint hash
  formatting changes
  change `L_{NAM}` -> `L_{PoS}` for clarity and consistency
  change inflation `I` to have units of tokens per epoch
  fix term ordering in error calculation
  Remove other `:=` in favor of `=`
  distinguish new and old inflation rates with a prime
  fix md rendering
  correct the shielded pool error calculation
  change storing of error to storing of token ratios (same procedure)
  fix: `I` is percent per annum
  distinguish between `K` in storage and `K` as intermediate value in inflation calculation
  Use `I` for inflation rates, as `R` reserved for locked ratios
  specify some default values, other small edits
  release: add scripts/release.sh
  release: add release.toml to wasm workspace and wasm_for_tests
  release: don't tag from cargo release
  release: update release.toml for cargo-release 0.21.4
  wasm: remove tx_from_intent build
  wasm: repair wasm checksums
  Add changelog
  Add changelog
  Fix TransactionGasExceededed typo
  changelog: add #594
  shared/storage: fix the height recorded for a new epoch
  Apply suggestions from code review
  changelog: add #590
  wasm/tx_bond: fix delegation detection to compare source and validator
  wasm/tx_bond: add test seed which makes it fail
  Adds missing excape chars
  fix: governance docs latex
  ci: upload docs after build
  move unreleased changelogs accidentally added to v0.7.1
  Update .gitignore
  Add install-release target
  Update shared/src/ledger/ibc/handler.rs
  ci: added tendermint ad825dcadbd4b98c3f91ce5a711e4fb36a69c377
  [fix]: Fixed some array concatenations
  Update shared/src/ledger/ibc/handler.rs
  ci: fix build-and-test.yml
  ci: update wasm version
  ci: added gh action specific to eth-bridge-integration branch
  [feat]: Moved to ics23 v0.7.0. This came with some ibc updates as well
  Update README.md
  minor edits, ensuring consistency of terms
  updated the front page of docs
  added the right favicon
  ci: added slack secret
  changelog: add #452
  feat: rocksdb use jemalloc
  feat: update rocksdb version
  Enable mdbook-admonish for the specs mdbook
  [ci] wasm checksums update
  changelog: add #501
  fix e2e tests
  fix e2e tests
  Misc refactoring
  Uses `end_epoch` in `query_proposal_result`
  Refactors governance e2e tests
  [ci] wasm checksums update
  changelog: #503
  [ci] wasm checksums update
  remove unfinished lazy_set, lazy_hashset and lazy_hashmap for now
  ledger/storage/lazy: update lazy_set for updated trait LazyCollection
  Fixes specs
  [ci] wasm checksums update
  fix display proposal result in cli
  fix proposal_submission e2e test
  [misc] rebase
  ledger/storage/lazy: remove unused error cases
  WIP: Nested LazyMap validation and testing
  WIP: validation for lazy_map
  WIP: StateMachine tests for lazy_vec validation
  update wasm checksums
  changelog: add #500
  remove intent gossiper, matchmaker and their deps
  Adds `max_proposal_period` governance parameter
  Removes `max_proposal_fund_transfer` parameter
  Use proposal `end_epoch` instead of `start_epoch` for voting power
  ...
tzemanovic added a commit that referenced this pull request Nov 2, 2022
…wards

* origin/main: (632 commits)
  ci: use commit hash instead of pr number
  ci: fix binaries sha
  changelog: add #720
  fix: rename correctly in debug wasm build
  Namada 0.9.0
  release.sh: list prerequisites in a comment
  changelog: add #569
  queries: fix unused import in wasm build
  Fixes pgf council vote format
  Rwnames `type`, adds examples
  Custom proposal and vote memos in governance spec
  RPC: fix storage_value to return data as read w/o re-encoding in Option
  [ci] wasm checksums update
  router: add `with_options` for handlers that use request/response
  move the current RPC patterns under "shell" sub-router
  make fmt
  Log at INFO by default for namadan
  Add changelog
  ledger/queries: comment out `println`s for router path matching dbg
  ledger/queries: fix require_no_proof doc-string
  ci: fix workflow name
  ci: fix mold usage
  Update README.md
  some doc comment edits
  fix: namadan should log at info by default
  ci: use mold linker
  changelog: add #632
  feat: change native token to nam
  [ci] wasm checksums update
  changelog: add #671
  add back consensus timeout commit config for abciplus
  switch to tendermint-rs with consensus timeout
  wasm: update checksums
  changelog: add #553
  apps: replace RPC module and its handlers with new queries mod
  shared: add new queries router macro to replicate handwritten RPC paths
  add deps for router macro and update `Cargo.lock`s
  protocol: update imports and add missing rustdoc
  move ledger's protocol module into shared crate
  ci: invalide cf cache
  fix broken link
  split back out the core VPs
  Modify specs
  test/e2e/helpers: add a helper to query and parse block height
  changelog: add #658
  client: add a block query to print hash, height and time of a block
  Namada 0.8.1
  changelog: add #510
  [feat]: Make process proposal stateless
  test/e2e: fix node_connectivity test
  test/e2e: update expected string for non-validator node
  [fix]: Removed unnecessary patches in wasm
  [feat]: Patched tendermint-rs and ibc-rs to compatible versions
  app: set "namada" set default bin for `cargo run`
  wasm: update checksums.json
  [fix]: Fixed the borsh schema for libsecp256k signatures
  [feat]: Added the recovery id to secp256k signatures
  [ci] wasm checksums update
  feat: remove nft
  fix: rename anoma to namada, remove author print
  CI: add workaround for release build missing git tag
  Namada 0.8.0
  changelog: add #547
  wasm: update checksums
  [chore]: Lints and formatting
  [fix]: Fixed proof specs for non-existence proofs
  [fix]: Update the main tree when deleting a key
  [fix]: Fixed last ibc unit test
  [fix]: Fixed some tests.
  [feat]: Refactored the merkle tree into a more maintainable multi-store
  build: pin abciplus library revisions
  wasm: update checksums.json
  ci: standardize on one tendermint hash
  formatting changes
  change `L_{NAM}` -> `L_{PoS}` for clarity and consistency
  change inflation `I` to have units of tokens per epoch
  fix term ordering in error calculation
  Remove other `:=` in favor of `=`
  distinguish new and old inflation rates with a prime
  fix md rendering
  correct the shielded pool error calculation
  change storing of error to storing of token ratios (same procedure)
  fix: `I` is percent per annum
  distinguish between `K` in storage and `K` as intermediate value in inflation calculation
  Use `I` for inflation rates, as `R` reserved for locked ratios
  specify some default values, other small edits
  release: add scripts/release.sh
  release: add release.toml to wasm workspace and wasm_for_tests
  release: don't tag from cargo release
  release: update release.toml for cargo-release 0.21.4
  wasm: remove tx_from_intent build
  wasm: repair wasm checksums
  Add changelog
  Add changelog
  Fix TransactionGasExceededed typo
  changelog: add #594
  shared/storage: fix the height recorded for a new epoch
  Apply suggestions from code review
  changelog: add #590
  wasm/tx_bond: fix delegation detection to compare source and validator
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants