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

namadac epoch-sleep command #1621

Merged
merged 6 commits into from
Jul 22, 2023
Merged

namadac epoch-sleep command #1621

merged 6 commits into from
Jul 22, 2023

Conversation

juped
Copy link
Member

@juped juped commented Jun 27, 2023

read the commit messages

@juped juped requested a review from tzemanovic June 27, 2023 20:23
Add the epoch-sleep helper, which queries the current epoch and then
sleeps until the epoch is greater (polling once a second). This can
replace the multiple namadac invocations used in e2e tests.
Instead of manually querying, we now epoch-sleep until the next epoch,
limiting the number of clients invoked to 1.

Also update the epoch sleep e2e test to check the return value (parsed
from the output of epoch-sleep).
PoS hammered the node as fast as possible with epoch queries in its
tests to wait for a specified epoch. Instead, epoch-sleep repeatedly
until the target epoch has been reached.

This could be improved further by adding an --until parameter to
epoch-sleep.
tzemanovic
tzemanovic previously approved these changes Jun 28, 2023
@Fraccaman
Copy link
Member

what should we do with this one?

@tzemanovic
Copy link
Member

what should we do with this one?

let's merge

@tzemanovic
Copy link
Member

it's doable to make this a utils sub-command which would be preferable - I'll rebase it and make the change

@@ -466,6 +455,18 @@ pub async fn main() -> Result<()> {
Utils::DefaultBaseDir(DefaultBaseDir(args)) => {
utils::default_base_dir(global_args, args)
}
Utils::EpochSleep(EpochSleep(mut args)) => {
let mut ctx = cli::Context::new(global_args)?;
Copy link
Member

Choose a reason for hiding this comment

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

@juped other utils don't have context, but it's possible to construct it here

tzemanovic
tzemanovic previously approved these changes Jul 11, 2023
tzemanovic added a commit that referenced this pull request Jul 11, 2023
* ray/utils-next-epoch:
  changelog: add #1621
  apps: move epoch-sleep client cmd under utils
  tests/e2e: replace PoS test epoch waits with epoch-sleeps
  tests/e2e: change epoch_sleep to use namadac epoch-sleep
  apps: add namadac epoch-sleep
@tzemanovic tzemanovic mentioned this pull request Jul 11, 2023
@@ -4663,6 +4664,52 @@ fn implicit_account_reveal_pk() -> Result<()> {
Ok(())
}

#[test]
fn test_epoch_sleep() -> Result<()> {
Copy link
Member

Choose a reason for hiding this comment

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

the new test has to be added to .github/workflows/scripts/e2e.json to run in CI

tzemanovic added a commit that referenced this pull request Jul 11, 2023
tzemanovic added a commit that referenced this pull request Jul 11, 2023
* ray/utils-next-epoch:
  ci/test/e2e: add new test
  changelog: add #1621
  apps: move epoch-sleep client cmd under utils
  tests/e2e: replace PoS test epoch waits with epoch-sleeps
  tests/e2e: change epoch_sleep to use namadac epoch-sleep
  apps: add namadac epoch-sleep
@juped
Copy link
Member Author

juped commented Jul 11, 2023

The additions are fine, but this was inexplicably rebased and needs to be un-rebased.

juped added a commit that referenced this pull request Jul 11, 2023
This reverts commit 119210b, reversing
changes made to 141ce4b.
juped pushed a commit that referenced this pull request Jul 11, 2023
juped added a commit that referenced this pull request Jul 11, 2023
* ray/utils-next-epoch:
  changelog: add #1621
  ci/test/e2e: add new test
  apps: move epoch-sleep client cmd under utils
  tests/e2e: replace PoS test epoch waits with epoch-sleeps
  tests/e2e: change epoch_sleep to use namadac epoch-sleep
  apps: add namadac epoch-sleep
juped added a commit that referenced this pull request Jul 11, 2023
evil changes:
- wait_until_node_is_synched now takes a &client
- qualified core::time::Duration in rpc epoch_sleep
@juped
Copy link
Member Author

juped commented Jul 11, 2023

unrebased and back on draft

@Fraccaman Fraccaman merged commit 9cc004f into main Jul 22, 2023
@Fraccaman Fraccaman deleted the ray/utils-next-epoch branch July 22, 2023 11:41
Fraccaman added a commit that referenced this pull request Jul 25, 2023
Namada 0.20.0 is a minor release addressing several improvements to the PoS system and the ledger stability.

* tag 'v0.20.0': (113 commits)
  Namada 0.20.0
  refator e2e masp tests
  fix tx_transfer
  ci: fix github colon parsing
  changelog: add #1693
  channgelog: add #1738
  [feat]: Moved cli commands common to testing, cli, and sdk out into apps
  ci: pre-download masp parameters
  changelog: add #1733
  pos/epoched: keep 2 past epochs of data by default
  changelog: add #1729
  test/ledger/finalize_block: fix slashing tests
  pos/slash: fix the validator state update to be in sync with set changes
  app/ledger/finalize_block: log block rewards before recording slashes
  test/e2e/slashing: extend the test to discover rewards issues
  pos: error out if validator is not in expected state for rewards
  changelog: add #1717
  test/shell/finalize_block: add some txs to DB commit test
  refactor: rename function
  refactor: rename method
  remove test_invalid_sender
  remove negative check
  ci: clean up
  fix formatting
  don't use flaky sleep
  refactor creation of namada nodes
  make Who clonable
  refactor: use immutable reference
  refactor: use immutable reference
  refactor: remove duplicated code
  test/e2e/slashing: wait for wasm on original validator
  add changelog
  fix changes in finalize_block
  remove vp_token
  changelog: add #1173
  client/rpc: use the new token balance method
  shared/ledger/queries: add token balance client-only method
  changelog: add #1692
  changelog: add #1670
  changelog: add #1667
  [fix]: Fixing errors introduced by merging in main
  [chore]: Incorporating in review comments
  Update core/src/types/uint.rs
  Update apps/src/lib/config/genesis.rs
  [fix]: Fixed the faucet to use uint instead of amount. This makes it portable across different assets
  converts faucet_withdrawal_limit to be correct
  changelog: add #1656
  pos: return sorted validator sets and code re-use for queries
  Expanding and fixing slashes query
  CLI query a validator's state
  query bonded-stake and order
  fix client_connections encoding
  handle errors for unjail-validator tx in the client
  expand and fix e2e test `double_signing_gets_slashed`
  add unjail tx at CLI
  changelog: add #1621
  ci/test/e2e: add new test
  apps: move epoch-sleep client cmd under utils
  changelog: add #1656
  pos: return sorted validator sets and code re-use for queries
  Expanding and fixing slashes query
  CLI query a validator's state
  update pr template
  test/e2e/proposal_submission: wait for proposal to be committed
  test/e2e/double_signing: path for validator copy that keeps logs in CI
  add comments
  fix according to feedback
  refactor: fix formatting
  add changelog
  refactor: simplify code
  refactor: introduce name for magic constant
  add test case
  feat: store total consensus stake; garbage collect validator sets
  query bonded-stake and order
  wait for wasm-precompile before expecting block hash
  changelog: add #1605
  apps: use fd-lock instead of file-lock for cross-platform support
  changelog: add #1695
  deps: update sysinfo to latest 0.29.4
  improve error handling for `set_initial_validators`
  changelog: add #1686
  app/ledger/finalize_block: refactor validator set update for re-use
  app/ledger/init_chain: get genesis validator set using the new fn
  pos: add a function to get genesis validator consensus set for TM
  fix a test
  fix for tx signing
  for clippy
  fix multitoken vp to check the minter
  for clippy
  modify EthBridge VP and EthBridgePool VP for multitoken
  revert unexpected changes
  change eth_bridge balance keys to multitoken keys
  add unit tests
  remove InternalAddress::Minted
  rename
  fix token decoding
  fix balance print
  add multitoken VP file
  change to multitokens
  change multitoken
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants