celestiaorg / celestia-core

A fork of CometBFT
Apache License 2.0
489 stars 269 forks source link

dummyapp: custom block time #383

Closed Wondertan closed 3 years ago

Wondertan commented 3 years ago

Currently, Dummyapp provides a sleep parameter that freezes block production for the specified period. However, long sleep >10sec causes consensus timeouts leading to endless round restart preventing chain growth, while customizable block time is very helpful in testing block providing and retrievability.

tac0turtle commented 3 years ago

This can be done by using the values in the config.toml around timeouts for consensus rounds. Unfortunately, these are local configurations instead of network wide. Like most things in tendermint, we have an issue for this....

liamsi commented 3 years ago

https://github.com/lazyledger/lazyledger-core/blob/40acb17283ebfe1c49b804a786464b93c2213a97/config/toml.go#L362-L377

Also ref: https://github.com/lazyledger/lazyledger-core/issues/87

liamsi commented 3 years ago

@Wondertan I just confirmed that after editing ~/.tendermint/config/config.toml and modfying only the propose timeout to eg.:

timeout-propose = "12s"
 ./dummyapp run --dummy.sleep 10s --dummy.txs 10

works just fine:

I[2021-06-02|09:57:13.194] Executed block                               module=state height=1 validTxs=20 invalidTxs=0
I[2021-06-02|09:57:13.194] Committed state                              module=state height=1 txs=20 appHash=2800000000000000
I[2021-06-02|09:57:24.388] Executed block                               module=state height=2 validTxs=20 invalidTxs=0
I[2021-06-02|09:57:24.389] Committed state                              module=state height=2 txs=20 appHash=5000000000000000

Feel free to close the issue if this unblocks you. Otherwise, I think I need more details on how I can help.

Wondertan commented 3 years ago

Thanks! This should be enough for my goals