docs icon indicating copy to clipboard operation
docs copied to clipboard

feat: add docs for syncing from trusted hash and height

Open jcstein opened this issue 1 year ago • 3 comments

  1. go to ~/.celestia-light-mocha-4/config.toml and change DASer.SampleFrom to the trusted height
  2. set --headers.trusted-hash cc @S1nus for feedback. is the snapshot still required? or do we JTMB all previous heights < trusted height?

jcstein avatar Mar 06 '24 18:03 jcstein

it just trusts them if you do this

S1nus avatar Mar 06 '24 19:03 S1nus

awesome, makes sense!

jcstein avatar Mar 06 '24 19:03 jcstein

steps from @Bidon15:

  1. curl the rpc endpoint for the latest block -1
  2. take the hash
  3. init the light node with pre-defined config.toml
  4. experience immediate success

jcstein avatar Apr 03 '24 19:04 jcstein

  1. Get trusted height & hash on Celenium
  2. Set the trusted height & hash
    1. Open your config.toml:
    code ~/.celestia-light/config.toml
    
    1. Set DASer.SampleFrom to the trusted height.
  3. Initialize the node store
    celestia light init
    
  4. Run the node
celestia light start --headers.trusted-hash <hash>

jcstein avatar May 29 '24 22:05 jcstein

draft info portion for the documentation of this feature:

syncing to a trusted hash means that you will not sample the entire chain. this adds a trust assumption that you trust the history of chain up to that point and that you trust the entity where you get the hash from. in this case, Celenium

jcstein avatar Jun 04 '24 18:06 jcstein

note: if you're using all of these light nodes for similar things like tracking the same rollup, I'd recommend using the same hash/height for them all. you can also skip the celenium part and do step 1 programmatically with a consensus rpc (like the core.ip you provide to a light node, whether it's from a provider or from your own consensus node)

jcstein avatar Jul 19 '24 15:07 jcstein

I think that the above suggestion may not be ideal for fresh nodes:

  1. Get trusted height & hash
  2. Initialize the node store
    1. celestia light init
  3. Set the trusted height & hash
    1. Open your config.toml code .celestia-light/config.toml. Set DASer.SampleFrom to the trusted height (e.g. SampleFrom = 123456)
  4. Run the node with the hash and flag:
celestia light start --headers.trusted-hash <hash>

jcstein avatar Jul 23 '24 19:07 jcstein