-
Notifications
You must be signed in to change notification settings - Fork 145
client-stateless: GetLastRetainedHeight method returns light client's oldest height #6385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
client-stateless: GetLastRetainedHeight method returns light client's oldest height #6385
Conversation
✅ Deploy Preview for oasisprotocol-oasis-core canceled.
|
56168db to
4546610
Compare
|
This may cause reverse issues now, e.g. if your provider has less history then your configured trust. Log when configuring trust height that is 9 days old against my localhost provider that has history from 8 days ago: {"caller":"indexer.go:237","err":"failed to reindex batch: failed to get runtime state: failed to get state root: failed to get transactions from any provider: rpc error: code = Unknown desc = cometbft: block query failed: height 29025440 is not available, lowest height is 29051682","height":29165710,"level":"warn","module":"runtime/history/indexer","msg":"failed to reindex blocks","runtime_id":"000000000000000000000000000000000000000000000000a6d1e3ebf60dff6c","ts":"2025-11-03T10:07:47.573477627Z"}I believe this change is still correct, and the log is expected. It is your responsibility to configure correct trust against the configured providers. Sure we could find a minimum of your trust and all providers last retained height. But then there is composed provider, scorer etc. Also what if the one provider with most retained history suddenly stops serving... Worst case you again rely on this log so we don't solve anything with complicating things. Nevertheless, my suggestion is to reflect this requirement under Setting trust root for stateless client node - "configured trust should be younger than your providers last retained height, taking their pruning and your speed of reindexing into account". See existing discussion oasisprotocol/docs#1472 (comment). Realistically if you configure a recent/latest trust as suggested this is not a problem at all. |
|
Yes, I was thinking about that during review, and the node should probably switch to another provider if data cannot be found. Another option would be to take |
And even with that you are not safe as the max may prune right after. I suggest merging this for now, and encourage to use very recent if not latest trust root given that anything else is impractical and slow. |
Closes #6382
How to test:
Run stateless client node with at least one configured runtime (triggers history reindex).
Prior to this fix, if you set your trust root to be younger than your configured provider's last retained height, your indexer will get stuck. This PR should fix this.