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

Ensure empty_blocks=false working #230

Open
ethanfrey opened this issue Jan 12, 2022 · 7 comments
Open

Ensure empty_blocks=false working #230

ethanfrey opened this issue Jan 12, 2022 · 7 comments
Assignees
Labels
M Medium task, 1-3 days work state_breaking

Comments

@ethanfrey
Copy link
Member

ethanfrey commented Jan 12, 2022

Why: To ensure the liveness of the network

Test this and see what we need to adjust

Update (Alex):
This are configuration flags in the <tgrade-home>/config/config.toml file.

# EmptyBlocks mode 
create_empty_blocks = false
# possible interval between empty blocks
create_empty_blocks_interval = "5m"

Watch server logs or server console at port 26557 (default) for blocks created

See setup.sh + start.sh

@ethanfrey ethanfrey added this to the Tgrade 0.6 milestone Jan 20, 2022
@alpe alpe added M Medium task, 1-3 days work S Small, <1 day work and removed M Medium task, 1-3 days work labels Jan 21, 2022
@alpe alpe added the good first issue Good for newcomers label Feb 16, 2022
@pinosu pinosu self-assigned this Mar 28, 2022
@pinosu
Copy link
Contributor

pinosu commented Mar 28, 2022

@alpe I tested this and empty blocks are created even if :

  • create_empty_blocks = false
  • create_empty_blocks_interval = "5m"

@pinosu
Copy link
Contributor

pinosu commented Mar 28, 2022

I think this is relevant in our case: tendermint/tendermint#1995
Basically if the app hash changes, these flags are not respected and an empty block is created.
This is related to issue #99 . BlockHeaders are tracked all the time but validator sets are always nil

var valSet stakingtypes.Validators // not used by IBC so we keep it empty
. This makes the state hash change all the time and that's why empty blocks are created. I tried to make a change in this PR and it actually fixed the issue. @alpe I am not sure it is the right solution, but it might help in future debugging.

@alpe
Copy link
Contributor

alpe commented Mar 29, 2022

This is indeed the issue. For each new block we store the app hash in begin_block (for ibc historical info) which then modifies state to cause the next block to be created. Good digging @pinosu

@ethanfrey
Copy link
Member Author

Very good find as to the cause!

@ethanfrey
Copy link
Member Author

If #99 is solved, should this work? Or is there something else that is updating all the time?

For each new block we store the app hash in begin_block (for ibc historical info)

We store the app hash? Or the validator hash?

@alpe
Copy link
Contributor

alpe commented Mar 29, 2022

Issue #99 should have been closed already. The valset was not persisted with historic information and the app hash is required for IBC.
I can confirm that without the state change due to historic information no empty blocks are created

@alpe
Copy link
Contributor

alpe commented Apr 1, 2022

Some notes from discussions:

Possible solutions:

  • Query the tendermint db directly:
    • Problem with prune settings so that not all historic data may be available in vanilla Tendermint
  • Non IAVL DB that persists the historic information
    • Can be setup in app.go and passed to the poe begin blocker via context for example.
    • Important to handle cached writes vs committed writes proper

@alpe alpe added M Medium task, 1-3 days work and removed good first issue Good for newcomers S Small, <1 day work labels Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M Medium task, 1-3 days work state_breaking
Projects
None yet
Development

No branches or pull requests

3 participants