interop: Reset Derivation and Backfill Supervisor when Too Far Behind #12919
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Forces the
op-node
to reset its Derivation Pipeline when an error is returned from the Supervisor regarding being "too far behind"Why
Currently, there exists no persisted "L1 <> L2" Derivation Relationship. In the future, we would like to use a Safety Index to track the derivation increments the Node has processed.
Because there is no persistence of DerivedFrom information, if the Supervisor is ever not able to subscribe to new Safety information (eg because it is offline), there is no way to replay that call. As a result, if the Supervisor is offline for any duration, it comes back up with a gap in its data which cannot be filled by calls from the node.
So now in this PR, when this gap scenario is encountered, an error is emitted back to the Node. The Node in turn notices that the Supervisor is "too far behind", and emits a Derivation Reset Event.
How
The phrase
"too far behind"
is used in error checking failures when callingUpdateLocalSafe
. I did it this way because error type-checking seems to not survive when the error transports over RPC (please LMK if that's incorrect, but it was my experience during development).When the
AddDerived
function of the Supervisor finds that the new data is more than one ahead of the existing derivation data, it returns the error:Testing
I tested this using a
local-devnet
, which was not very efficient, but was the most obvious reproduction I came up with. To test, I started a fresh network, stopped the Supervisor for some time, and then restarted it.Future
We should really consider architectural changes that eliminate this required coordination in favor of stronger consistency ownership by the Supervisor. See this document for more for more words about that.
Notes
I also had to disable Batcher Throttling, which seems to prevent the devnet from coming up right now. I think it makes sense to disable for devnets generally, but we should also investigate this. CC @sebastianst