palomachain / paloma

The fast blockchain messenger protocol
Apache License 2.0
291 stars 135 forks source link

Periodically update xchain reference blocks #1175

Closed maharifu closed 5 months ago

maharifu commented 5 months ago

Related Github tickets

Background

At startup, pigeon validates that it's talking to the right chain by using the reference block height and hash. These values are introduced when first integrating a chain. However, as time passes, some RPC providers will prune block information, which makes it impossible for pigeon to verify the blocks.

To solve this, we introduce a new periodic task that at each 10000 blocks, sends a message requesting pigeons to update the reference block information (height and hash) for each supported chain.

We add a new queue - evm/<CHAIN>/reference-block - and follow the same flow from ValidatorBalances.

Related pigeons changes are handled in https://github.com/palomachain/pigeon/pull/393

Testing completed

Breaking changes