consensus-shipyard / ipc

🌳 Spawn multi-level trees of customized, scalable, EVM-compatible networks with IPC. L2++ powered by FVM, Wasm, libp2p, IPFS/IPLD, and CometBFT.
https://ipc.space
Apache License 2.0
40 stars 34 forks source link

Optimize empty bottom up checkpoint submission #648

Open cryptoAtwill opened 7 months ago

cryptoAtwill commented 7 months ago

When there are no validator changer nor bottom up cross net messages, we should not submit empty bottom up checkpoints.

Initial brainstorming from @aakoshh:

Perhaps it needs the following parameters:
number of pending messages before immediate checkpoint is triggered
number of blocks after which a checkpoint is sent iff there are pending messages
number of block after which a checkpoint is sent even if empty

E.g we send a checkpoint if:
there are more than 100 bottom up messages in the outbox, or
there are less than 100 messages but more than 0 and we haven’t sent a checkpoint in the last 50 blocks, or
we haven’t sent a checkpoint in the last 1000 blocks
linear[bot] commented 7 months ago

ENG-630 Optimize empty bottom up checkpoint submission

cryptoAtwill commented 6 months ago

One way we can skip empty checkpoint is not creating empty checkpoint in the first place. Then we add one more field to BottomUpCheckpoint struct previousCheckpoint, in gateway we just need to ensure the previousCheckpoint sent from checkpoint matches the storage.

raulk commented 6 months ago

Indeed, creating a checkpoint chain authenticates skipped checkpoints at origin.