chore: remove backwards compatibility with 2.6.0#5415
chore: remove backwards compatibility with 2.6.0#5415sbackend123 wants to merge 15 commits intomasterfrom
Conversation
|
@sbackend123 I think that removing all migration code might be a bit too eager - can you make sure that the migration code covers the currently active bee node version still showing up in swarmscan? |
I agree, as there are still 2.6 nodes (not many, but still ~6%), it is early to release bee without compatibility. This code is intended to be temporary. It is a good effort, but I would suggest to hold on merging, for some time. |
I ran the previous bee version (v2.6.0) locally, let it sync to current block height on maiinet and build a real data directory. Then I started this build on the same data directory without clearing it. The node started successfully with no migration errors. I also ran earlier versions trying to sync with mainnet, but get error |
I suppose it does not error the migrations because there's nothing to do in the migrations in the current build. I am not 100% sure about the reasoning behind the necessity of those migrations. But we should definitely leave in place the migration code to support the migration path from the node version still running on the network (2.6.0 definitely). The older ones we can mark as nops. |
Those 2.6.0 nodes are on some |
|
@sbackend123 this needs a rebase |
acud
left a comment
There was a problem hiding this comment.
there's a whole chunk of changes that are in pkg/storer/migration/all_steps.go that is completely not touched but the code can probably also be removed. as for the individual migration steps which are not in use already - there's no need of keeping the files with empty functions that do nothing - those can be removed.
|
|
||
| func firstByteString(data []byte) string { | ||
| if len(data) == 0 { | ||
| return "none" |
| // step_02 was a migration step that migrated the cache to a new format. | ||
| // It is now a NOOP since all nodes have already run this migration, | ||
| // and new nodes start with an empty database. | ||
| func step_02(_ transaction.Storage) func() error { |
There was a problem hiding this comment.
if this is not used anywhere - why do we need to keep the file?
…2.6.0 # Conflicts: # pkg/p2p/libp2p/version_test.go # pkg/statestore/storeadapter/migration.go # pkg/storer/internal/reserve/olditems.go # pkg/storer/migration/refCntSize.go # pkg/storer/migration/step_02.go # pkg/storer/migration/step_04_test.go # pkg/storer/migration/step_05.go # pkg/storer/migration/step_05_test.go # pkg/storer/migration/step_06.go # pkg/storer/migration/step_06_test.go
Add test. Move db repair tool.
If I understand everything correctly, we can't remove it completely because of our migration mechanism. |
|
|
||
| func (a *Address) UnmarshalJSON(b []byte) error { | ||
| v := &addressJSON{} | ||
| err := json.Unmarshal(b, v) |
There was a problem hiding this comment.
Nice work @sbackend123.
I just have a concern here, what will happen for the 2.6.0 nodes here ? because I see you removed Underlay field from addressJSON, I know this is not needed anymore, but in the Unmarshal the node will have the Underlays filed empty.
Maybe we can keep it in addressJSON (just to for the Unmarshal) and we get that Underlay addr and set it to Underlays slice
Right or maybe I'm missing some parts ?
There was a problem hiding this comment.
This is main point, we remove compatibility with 2.6.0 so minimal supported version would be 2.7.0. So we force everybody update their versions
There was a problem hiding this comment.
Yes, I know.
I’m just thinking out loud, if I were a node operator on 2.6.0 or earlier, I might suddenly get disconnected without really understanding why. That could be a bit confusing.
But as @janos mentioned, those nodes are only around 6%, so the impact seems pretty small.
| 4: legacyNoopStep, | ||
| 5: legacyNoopStep, | ||
| 6: legacyNoopStep, | ||
| 7: legacyNoopStep, |
There was a problem hiding this comment.
please add a comment here that noop steps should never be removed since it would cause the new migrations to not execute on old nodes that have a higher migration version. the same on the legacyNoopStep - it should explicitly be commented that any migration step marked with this function should never be modified or touched and that the noop function should not be removed. i can easily see an LLM agent "refactoring" this out in the future and breaking stuff because it might not see the bigger context of this.
| 5: noop, | ||
| 6: noop, | ||
| 7: noop, | ||
| 8: noop, |
There was a problem hiding this comment.
like in the other migrations comment - the sequence and indexes of these migrations should be commented such that they aren't removed in the future
Checklist
Description
Removed code for backwards compatibility with version 2.6.0
Breaking change:
Single underlay address serialization is not supported anymore, wire encoding is now list-only.
The underlay prefix and deserialization of a single underlay address are kept for backward compatibility with the current network. Otherwise the handshake with bootnodes fails.
Open API Spec Version Changes (if applicable)
Motivation and Context (Optional)
Related Issue (Optional)
#5340
Screenshots (if appropriate):
AI Disclosure