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

updated delegation script #595

Merged
merged 3 commits into from Jul 1, 2019

Conversation

Projects
None yet
2 participants
@dorin100
Copy link
Contributor

commented Jul 1, 2019

These changes should help to avoid issues like input-output-hk/shelley-testnet#12

  • updated delegation script in order to wait for transactions to be included into blocks
  • added a comment for each operation in order to highlight the steps to have the delegation created and verified
  • removed the debug command (set -ex) in order to keep only the steps into de log (otherwise the waitNewBlockCreated function is quite noisy)
@NicolasDP
Copy link
Collaborator

left a comment

120sec is very arbitrary here. we can instead do something based on the SLOT_DURATION:

SLOT_DURATION=10

Which is controlled by the bootstrap option parameter:

s) SLOT_DURATION="${OPTARG}" ;;

Which could be reused by updating the process_file function:

process_file() {
FROM=${1}
TO=${2}
sed -e "s/####FAUCET_SK####/${FAUCET_SK}/" \
-e "s/####BLOCK0_HASH####/${BLOCK0_HASH}/" \
-e "s;####REST_URL####;${REST_URL};" \
-e "s;####CLI####;${CLI};" \
-e "s/####COLORS####/${COLORS}/" \
-e "s/####FEE_CONSTANT####/${FEE_CONSTANT}/" \
-e "s/####FEE_CERTIFICATE####/${FEE_CERTIFICATE}/" \
-e "s/####FEE_COEFFICIENT####/${FEE_COEFFICIENT}/" \
-e "s/####ADDRTYPE####/${ADDRTYPE}/" \
-e "s/####STAKE_POOL_ID####/${STAKE_POOL_ID}/" \
< ${FROM} > ${TO}
chmod +x ${TO}
}

in order to have the slot duration available in this script too. Then you could attempt N retries (TBD) and wait for SLOT_DURATION instead of 120 times 1 seconds.

@NicolasDP NicolasDP self-assigned this Jul 1, 2019

@NicolasDP
Copy link
Collaborator

left a comment

Looking better. Why 50 time actually?

could you put the 50 in a variable at the top ?

@dorin100

This comment has been minimized.

Copy link
Contributor Author

commented Jul 1, 2019

  1. in order for a transaction to be included in a block, we need to wait:
  • for BFT - only 1 block;
  • for Genesis, with default config (consensus_genesis_praos_active_slot_coeff: 0.1, 1 pool) - 10 blocks!? (from logs I can see that some time blocks are created even at ~20 blocks).
  • I chose 30 in order to be sure that the transaction will always be included in a block (any suggestions?)
  1. sure
moved the TIMEOUT_NO_OF_BLOCKS as a general variable
waiting specified number of blocks

@NicolasDP NicolasDP merged commit 1a0be06 into input-output-hk:master Jul 1, 2019

9 checks passed

ci/circleci: build_debug Your tests passed on CircleCI!
Details
ci/circleci: build_nightly Your tests passed on CircleCI!
Details
ci/circleci: build_release Your tests passed on CircleCI!
Details
ci/circleci: cargo_fetch Your tests passed on CircleCI!
Details
ci/circleci: rustfmt Your tests passed on CircleCI!
Details
ci/circleci: test_debug Your tests passed on CircleCI!
Details
ci/circleci: test_nightly Your tests passed on CircleCI!
Details
ci/circleci: test_release Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.