-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: implement safe
tag in tipset selection
#13034
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
Conversation
Implement the ability to select a tipset by tag `safe`. The safe tag would select the earliest between finalised and heaviest - 200.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the PR title to match https://github.com/filecoin-project/lotus/blob/master/CONTRIBUTING.md#pr-title-conventions
safe
tag in tipset selectionsafe
tag in tipset selection
PR title now matches the required format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good to me other than introducing a different safe value for non-ETH APIs
Here's what looks like with that 2^-30 guarantee line in green: log scale: When looking at this, I didn't observe it go beyond 25 epochs to get to this level, even when the chain got a bit choppy. But I don't think I went back and looked at particularly problematic points in the life of the chain either so it may get worse. But from a "not necessarily final, but most probably safe", 30 seemed like a reasonable choice. There was a page somewhere that listed the current bridges and their choices of finality time, they ranged from 60 to 200 IIRC, that also gives an indication of what is considered "almost final" but mostly I think that just comes from our recommendations anyway. @eshon do you have any more info on this? IMO 30 is a good compromise, it's not finalized, but having a "safe" that's distinct from "finalized" should suggest that it's not going to be 100%, you'd pick "finalized" if you wanted that. Hopefully with F3 working properly this becomes mostly irrelevant. |
I'd be careful about just hard-coding something as low as "30 epochs" without having some kind of "is the chain healthy" check. I'm mostly worried about an API provider getting stuck on a fork and not responding within ~15m. Ideally we'd use the finality calculator, or at least estimate the safe distance by counting blocks not epochs/tipsets. I.e., walk back from the heaviest tipset until we've passed |
I have a semi-working FRC-0089 finality calculator in Go but got stuck with some of the math library dependencies so never managed to finish it, at least I got frustrated enough to put it down. I could dig that code up if someone wants to help get it over the line. |
So far I have not heard back from zondax on the value of constant. I would vote for landing this with a more conservative value: either leave it to 200 or settle for 150 and revisit later.
Thoughts @rvagg @Stebalien @Kubuxu ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, good by me, I'll even adjust ETH APIs for /v2 to follow this behaviour when f3 isn't available, I'll leave /v1 alone for now
@rvagg - This is a comparison of high TPS chains that can be sorted by finality... https://chainspect.app/dashboard (Bridge finality will depend on the finality of the chains being used but AxelarScan can probably update confirmations of Filecoin bridged txns based on updates to the Filecoin Eth RPC API.) I am much more concerned that we are going to confuse exchanges greatly if we message them about F3 too soon because we won't be able to share expected confirmation times as in the Kraken Docs on confirmation times, and vigilant network monitoring will be required for a while until F3 participation is tied to BRs. It would be bad PR if F3 halting became a news item that we had to explain to exchanges. Perhaps FilOz should delay F3 messaging for a couple months until further analysis can be done on its performance. |
I think this is reasonable and I would like to point out that this conversation just needs more data, which is being collected as we speak. I suggest we revisit the messaging after the passive testing is done. |
Echoing my response to the review comment above:
Based on the rationale above, I am merging this PR and postponing further discussion on the value of "safe" constant until there is more data. |
Implement the ability to select a tipset by tag
safe
. The safe tag would select the earliest between finalised and heaviest - 200.Part of: #12990