babylonchain / babylon

Main repo for Babylon full node
https://babylonchain.io
Other
232 stars 162 forks source link

zoneconcierge: avoid querying historical state by generating proofs upon sealing epochs #636

Closed SebastianElvis closed 3 months ago

SebastianElvis commented 4 months ago

This PR fixes #635 by generating and saving proofs upon an epoch is sealed, such that Babylon no longer requires nodes to not prune too many recent blocks.

This includes

SebastianElvis commented 3 months ago

One thing though, I wanted to verify if everything works as expected mostly for case when somebody prunes everything.

So I have tweaked nodes in e2e test to have pruning option everything and test seemed to pass. I was mostly interested in TestBTCTimestampingPhase2RlyTestSuite testcase.

On the other hand when I looked at logs in e2e, I saw this errors messages:

11:54AM INF packet acknowledged dst_channel=channel-0 dst_port=wasm.bbn14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sw76fy2 module=x/ibc/channel sequence=2 src_channel=channel-0 src_port=zoneconcierge
11:54AM ERR received an Acknowledgement error message error="invalid packet: Generic error: failed to initialize Babylon epoch: The epoch is not sealed by the epoch's validator set: checkpoint's block_hash (83ce19d759113cdebd2cf26eb41d5e2b9addb9b5c629413f516ce88d0003d525) is not equal to epoch's sealer_block_hash ()" module=x/ibc-zoneconcierge

Do you think this is some problem or rather our e2e tests being not perfect ?

Nice catch! I have bumped Babylon contract and now the acknowledgment becomes successful. It is because the babylon contract is not the updated version. Please take a look again.

We could add more assertions in timestamping integration e2e in subsequent PRs.