Conversation
It's because the first block now takes 70 seconds. |
|
so do we need to increase it because that code reflects the state of this branch |
|
I think it's already merged in master. When I checked on Monday, the first block duration had increased to 2 sessions |
|
So it was at 80000 (see the first error where it prints |
|
TODO: use promises like XCMP tests so that |
The reason why this wouldnt work before is because we need to use the inBlock event instead of isFinalized I think. If you create an issue for that, I would be happy to take care of it.
From the logs, it looks like the block #1 still hasnt been created when the error fires |
JoshOrndorff
left a comment
There was a problem hiding this comment.
Spec-wise this is exactly what I was suggesting :)
|
I'm getting |
|
ha ok its probably because I didn't run |
node/src/chain_spec.rs
Outdated
| "staking", | ||
| ChainType::Local, | ||
| move || { | ||
| testnet_genesis( |
There was a problem hiding this comment.
Would be nice to have a comment explaining what each line is for so that I can modify it myself. Does this allow changing the config of every pallet we have, like the specs did?
There was a problem hiding this comment.
It's calling the function a few lines below called testnet_genesis so you can't fully understand the config without looking at what that function does with it. I added some comments to improve readability though.
There was a problem hiding this comment.
It provides almost as much configurability as the json spec. Instead of setting the balances for accounts, it mints 1 << 80 balance for the specified endowed_accounts: Vec<AccountId>.
There was a problem hiding this comment.
It provides almost as much configurability
If the current approach doesn't suit your needs, we can change that testnet_genesis function or remove it, or whatever makes it most expressive.
We only have to build it once. The binary compiled with the feature flag will work with the other tests because it only adds the This will be a lot easier to include in the CI than the json spec because the binary includes the config instead of requiring changes to the json spec.
It worked for me but took 110.947 seconds to produce the first block -- here is the output: |
node/src/command.rs
Outdated
| #[cfg(feature = "test-staking")] | ||
| "staking" => Ok(Box::new(chain_spec::staking_spec(para_id))), |
There was a problem hiding this comment.
This is a great idea. Might make sense to do the same thing for stagenet in the future.
|
* added example test for frontier (#343) * added example test for frontier * added npm run non-ci-test * move staking test spec to node/chainspec (#335) * init * hide staking test spec behind test-staking feature flag * clean * comment staking test genesis config for readability * move test spec to separate file * Crude attempt at finding open ports * npx -w * Add missing file * Adds random port and parallel test execution * Fixed ethers test * Adds delay to node start in test Co-authored-by: Antoine Estienne <estienne.antoine@gmail.com> Co-authored-by: Amar Singh <asinghchrony@protonmail.com> Co-authored-by: Crystalin <alan@purestake.com>
* Crude attempt at finding open ports (#346) * added example test for frontier (#343) * added example test for frontier * added npm run non-ci-test * move staking test spec to node/chainspec (#335) * init * hide staking test spec behind test-staking feature flag * clean * comment staking test genesis config for readability * move test spec to separate file * Crude attempt at finding open ports * npx -w * Add missing file * Adds random port and parallel test execution * Fixed ethers test * Adds delay to node start in test Co-authored-by: Antoine Estienne <estienne.antoine@gmail.com> Co-authored-by: Amar Singh <asinghchrony@protonmail.com> Co-authored-by: Crystalin <alan@purestake.com> * Crystalin testweek watch (#347) * Crude attempt at finding open ports * npx -w * Add missing file * Adds random port and parallel test execution * Fixed ethers test * Adds delay to node start in test * Adds support for test watch * Cleaned package.json * Prevent test to run at start of watch * Restore optimization for cargo build Co-authored-by: Stephen Shelton <steve@brewcraft.org> * Unskip tests (#357) * Unskip `fetch genesis block by hash` * Remove timeouts * Unskip block gas limit tests * Remove `opt-level = 0` from Cargo.toml * Unskip * Test contract factory (#351) * added deployContractByName and contractSources * added getcompiled function * increase timeout for testfilterapi * change contract name and add sourcecode * Fix fixture requirement * update package and json Co-authored-by: Crystalin <alan@purestake.com> * Gorka remove intra test dependencies (#355) * Crude attempt at finding open ports * npx -w * Add missing file * Adds random port and parallel test execution * Fixed ethers test * Adds delay to node start in test * Adds support for test watch * Cleaned package.json * Prevent test to run at start of watch * Restore optimization for cargo build * Allow for non-finalization and ParentHash specification in createAndFinalizeBlock * Make test-block tests non-dependent by using non-finalized chains * Separate tests to make them non-dependent and parametrize tx hashes and nonces in test-txpool * it instead of step in test-version * setup providers before tests in test-ethers.ts * Create a block before tests to avoid one depend on the other in test-nonce * it for step in test-receipt * import constants for test-staking * Attemp at parametrizing test-filter-api tests * attemp at parametrizing test-revert-receipt * remove mocha-steps from tests * make test-subscription tests non-dependent * comply with prettier * Add support for retrieving the hash of the generated block * Make test-trace-filter tests non-dependent * balance-tests non-dependent * Non-dependent tests for test-polkadot-api * Add test-fork-chain tests * remove unnecesary timeouts * Use context provider for test-ether.ts * Remove currentId from test-filter-api since we are uninstalling all filters from test to test * Join balance test setups and check balance at each block * Rename variables to camelCase in tests * small introduced bug in test-pool-pending when camelCasing variables * Use a different account for test-revert-receipt deployment contract to avoid non-determinism of the nonce * shorten line because of editconfig * Separate test-subscription and test-subscription-past-events.ts * remove single letter variable in test-filter-api * Small cosmetic changes * revert changes in package.json * Remove beforeEach and substitute it for common function * change var for let or const Co-authored-by: Stephen Shelton <steve@brewcraft.org> Co-authored-by: Crystalin <alan@purestake.com> * Crystalin remove solc (#362) * Crude attempt at finding open ports * npx -w * Add missing file * Adds random port and parallel test execution * Fixed ethers test * Adds delay to node start in test * Adds support for test watch * Cleaned package.json * Prevent test to run at start of watch * Restore optimization for cargo build * Allow for non-finalization and ParentHash specification in createAndFinalizeBlock * Make test-block tests non-dependent by using non-finalized chains * Separate tests to make them non-dependent and parametrize tx hashes and nonces in test-txpool * it instead of step in test-version * setup providers before tests in test-ethers.ts * Create a block before tests to avoid one depend on the other in test-nonce * it for step in test-receipt * import constants for test-staking * Attemp at parametrizing test-filter-api tests * attemp at parametrizing test-revert-receipt * remove mocha-steps from tests * make test-subscription tests non-dependent * comply with prettier * Add support for retrieving the hash of the generated block * Make test-trace-filter tests non-dependent * balance-tests non-dependent * Non-dependent tests for test-polkadot-api * Add test-fork-chain tests * remove unnecesary timeouts * Use context provider for test-ether.ts * Remove currentId from test-filter-api since we are uninstalling all filters from test to test * Join balance test setups and check balance at each block * Rename variables to camelCase in tests * small introduced bug in test-pool-pending when camelCasing variables * Use a different account for test-revert-receipt deployment contract to avoid non-determinism of the nonce * shorten line because of editconfig * Separate test-subscription and test-subscription-past-events.ts * remove single letter variable in test-filter-api * Small cosmetic changes * revert changes in package.json * Remove beforeEach and substitute it for common function * change var for let or const * Removes solc from tests * Fixes path for contract tests * Adds formatting for compiled contracts Co-authored-by: Stephen Shelton <steve@brewcraft.org> Co-authored-by: Gorka Irazoqui <gorka.irazoki@gmail.com> * Typescript test refactoring (#364) * Crude attempt at finding open ports * npx -w * Add missing file * Adds random port and parallel test execution * Fixed ethers test * Adds delay to node start in test * Adds support for test watch * Cleaned package.json * Prevent test to run at start of watch * Restore optimization for cargo build * Allow for non-finalization and ParentHash specification in createAndFinalizeBlock * Make test-block tests non-dependent by using non-finalized chains * Separate tests to make them non-dependent and parametrize tx hashes and nonces in test-txpool * it instead of step in test-version * setup providers before tests in test-ethers.ts * Create a block before tests to avoid one depend on the other in test-nonce * it for step in test-receipt * import constants for test-staking * Attemp at parametrizing test-filter-api tests * attemp at parametrizing test-revert-receipt * remove mocha-steps from tests * make test-subscription tests non-dependent * comply with prettier * Add support for retrieving the hash of the generated block * Make test-trace-filter tests non-dependent * balance-tests non-dependent * Non-dependent tests for test-polkadot-api * Add test-fork-chain tests * remove unnecesary timeouts * Use context provider for test-ether.ts * Remove currentId from test-filter-api since we are uninstalling all filters from test to test * Join balance test setups and check balance at each block * Rename variables to camelCase in tests * small introduced bug in test-pool-pending when camelCasing variables * Use a different account for test-revert-receipt deployment contract to avoid non-determinism of the nonce * shorten line because of editconfig * Separate test-subscription and test-subscription-past-events.ts * remove single letter variable in test-filter-api * Small cosmetic changes * revert changes in package.json * Remove beforeEach and substitute it for common function * change var for let or const * Removes solc from tests * Fixes path for contract tests * Adds formatting for compiled contracts * Refactor tests * Fix formatting * Limit concurrency to half cpus for ts tests * Fixes github action typo Co-authored-by: Stephen Shelton <steve@brewcraft.org> Co-authored-by: Gorka Irazoqui <gorka.irazoki@gmail.com> * Antoine update testweek readme typos (#369) * added instructions to readme * update package lock * Add missing contracts to definition (#368) * Add Callee, Caller, Incrementer * Update test-trace * Remove unused * Move blockscout tracer to util/tracer * Test for txpool multiple transactions (#367) * Improve pending pool test * Rephrase comment * Better naming for txpool tests * Split txpool multiple test for more independance * Fixes few test expectations * Adds test for future transaction * Rename eth pool correctly * Fixes node listeners Co-authored-by: tgmichel <telmo@purestake.com> * Fixes typo in variable name * Added test for block gas in smart contract (#370) * VSCode debugger (support for TS tests) (#348) Add a VSCode debugger config with CodeLLDB. TS tests can be debugged by first starting the node in the debugger, then launching DEBUG_MODE=true npm run test-single in the test folder (modify package.json to change the test file). * Adds test for filter trace pagination (#373) * Fixes trace filter test Co-authored-by: Stephen Shelton <steve@brewcraft.org> Co-authored-by: Antoine Estienne <estienne.antoine@gmail.com> Co-authored-by: Amar Singh <asinghchrony@protonmail.com> Co-authored-by: tgmichel <telmo@purestake.com> Co-authored-by: girazoki <gorka.irazoki@gmail.com> Co-authored-by: nanocryk <6422796+nanocryk@users.noreply.github.com>

What does it do?
Puts the genesis config information used in the polkadot-launch staking tests in
node/test_spec.rsThis will replace the
staking-test-spec.json, which required updating the system wasm code field every time anything in the runtime changes.To run, need to compile the node with flag
--features=test-spec. This ensures that the staking-test-spec hard coded intonode/test_spec.rsis only included in the binary when this flag is passed (and is NOT included when the flag is not passed). @joelamouche this will need to be included in the CIWhat important points reviewers should know?
Any long-living genesis config benefits from being coded in rust instead of the json spec because it is easier to maintain (because the json spec requires changing the wasm blob every time there is any runtime change).
Is there something left for follow-up PRs?
What alternative implementations were considered?
Are there relevant PRs or issues in other repositories (Substrate, Polkadot, Frontier, Cumulus)?
What value does it bring to the blockchain users?
Checklist