ethereum / trin

An Ethereum portal client: a json-rpc server with nearly instant sync, and low CPU & storage usage
382 stars 112 forks source link

feat(beacon): store `LightClientBootstrap` in separate db table #1413

Closed ogenev closed 2 months ago

ogenev commented 2 months ago

What was wrong?

This PR stores LightClientBootstrap beacon content in a separate table in the database. This is required because:

  1. To fix #1405, we need a way to get the latest stored block root from the latest bootstrap in the DB. This is solved by storing the block root as a primary key for the new bootstrap table. (content-id is not needed for the beacon network because the node radius does not apply to this overlay network).
  2. We want to purge all bootstraps older than 4 months. We can do this by adding a slot column in the bootstrap table and periodically purging all content where slot number < 4 months old.

How was it fixed?

To-Do