Add soroban_env_host::host::LegacyEpoch #754
Merged
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.
This adds a new mechanism for gating old behaviour in the host. Currently it's not used, but the idea is that as we discover divergence we will need to add branches to the code here and there to run "as if" we were an old version.
This is similar to the way protocol-version (and occasionally ledger-number) gating of backward-compatibility code happens in stellar-core, except that (a) ledger-number gating is both brittle and uninformative and (b) we don't have clear enough insight in advance of making a breaking change that we're doing so, due to the size of the dependency tree. So instead the embedder is forced to do a multi-step upgrade process, with two versions of the entire host active at once. The embedder should be able to do this correctly since it both sees the entire dependency tree of each host version it embeds, and can compare the history segment between the two for divergence and add legacy epochs to the host as necessary in order to achieve accurate replay.