celestia-app icon indicating copy to clipboard operation
celestia-app copied to clipboard

Prune the QGB state after the unbonding period ends

Open rach-id opened this issue 2 years ago • 6 comments

For the QGB, we only care about the state of the current unbonding period. That is due to the following:

  • If no signatures are posted during this period, then the orchestrator will be slashed (upcoming ADR).
  • After the unbonding period ends, even if the orchestrator doesn't sign, there is nothing to be done about them. Thus, we can get rid of the old state and only keep the one related to the current unbonding period.

rach-id avatar Apr 14 '22 09:04 rach-id

what state is left to prune after ADR005?

evan-forbes avatar Oct 03 '22 02:10 evan-forbes

We have the attestations requests that can be pruned. However, I guess we decided to dump them into block space. So, we will need to write an ADR about that

rach-id avatar Oct 03 '22 09:10 rach-id

oh shoot, did we? that does sound familiar but I at least didn't write it down anywhere :sweat_smile:. I actually think its ok to keep those, as that will make it quite a bit easier to do slashing, and its really not that much state.

We can still prune them though, even if its not that much state, it will just continue to grow forever for no reason.

evan-forbes avatar Oct 03 '22 17:10 evan-forbes

Then, we will not be able to sync QGB from genesis. Okey, makes sense. Thanks a lot

rach-id avatar Oct 03 '22 18:10 rach-id

Then, we will not be able to sync QGB from genesis.

ahh yeah! that was it.

they could using an archive node, but also from another evm chain that has already synced I think

evan-forbes avatar Oct 03 '22 20:10 evan-forbes

Cool then, let's prune then the attestations :fire:

rach-id avatar Oct 03 '22 22:10 rach-id

related to #683 now that the only state that we're keeping is requests

evan-forbes avatar Nov 08 '22 12:11 evan-forbes

Per sync, we need to prune every unbonding period and if it's number of attestations is below 100, don't prune

rach-id avatar May 09 '23 11:05 rach-id

@evan-forbes For this, I am thinking of creating a value in store: LastPrunedAttestationNonce to keep record of the last pruned nonce. Do we need to have this parameter as a gov upgradable? or for now, we can just hard code it? I think it's easier to hard code it + we can update it in an upgrade if needed.

rach-id avatar May 15 '23 15:05 rach-id

Final decision: Implement time based pruning

rach-id avatar May 23 '23 14:05 rach-id