Skip to content

chore: remove backwards compatibility with 2.6.0#5415

Open
sbackend123 wants to merge 15 commits intomasterfrom
chore/remove-backwards-compatibility-with-2.6.0
Open

chore: remove backwards compatibility with 2.6.0#5415
sbackend123 wants to merge 15 commits intomasterfrom
chore/remove-backwards-compatibility-with-2.6.0

Conversation

@sbackend123
Copy link
Copy Markdown
Contributor

@sbackend123 sbackend123 commented Mar 30, 2026

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

Removed code for backwards compatibility with version 2.6.0

  • WithBee260Compatibility
  • bee260BackwardCompatibility() methods
  • bee260Compatibility tracking map and related methods
  • FilterBee260CompatibleUnderlays() function
  • Bee260CompatibilityStreamer interface usage

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

  • This PR contains code that has been generated by an LLM.
  • I have reviewed the AI generated code thoroughly.
  • I possess the technical expertise to responsibly review the code generated in this PR.

@acud
Copy link
Copy Markdown
Contributor

acud commented Mar 31, 2026

@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?

@janos
Copy link
Copy Markdown
Member

janos commented Mar 31, 2026

@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.

@sbackend123
Copy link
Copy Markdown
Contributor Author

@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 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 connect new stream: incompatible stream: failed to negotiate protocol: protocols not supported.

@acud
Copy link
Copy Markdown
Contributor

acud commented Apr 1, 2026

@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 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 connect new stream: incompatible stream: failed to negotiate protocol: protocols not supported.

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.

@mfw78
Copy link
Copy Markdown
Collaborator

mfw78 commented Apr 2, 2026

I agree, as there are still 2.6 nodes (not many, but still ~6%), it is early to release bee without compatibility.

Those 2.6.0 nodes are on some dirty tag mostly, so it's on them. They are running custom code - we shouldn't be persisting with cruft in the protocol because someone doesn't update their modifications.

@acud
Copy link
Copy Markdown
Contributor

acud commented Apr 6, 2026

@sbackend123 this needs a rebase

@gacevicljubisa gacevicljubisa linked an issue Apr 9, 2026 that may be closed by this pull request
9 tasks
Copy link
Copy Markdown
Contributor

@acud acud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe just ""?

Comment thread pkg/storer/migration/step_02.go Outdated
// 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 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@sbackend123
Copy link
Copy Markdown
Contributor Author

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.

If I understand everything correctly, we can't remove it completely because of our migration mechanism.
Existing upgraded nodes may appear fine, but new installations would be broken, because ValidateVersions checks versions are without gaps (added unit test for that) and when we have currentVersion=0 and then next one 8 -> fail.

@sbackend123 sbackend123 requested a review from acud April 28, 2026 09:08
@sbackend123 sbackend123 marked this pull request as ready for review April 28, 2026 09:08
Comment thread pkg/bzz/address.go

func (a *Address) UnmarshalJSON(b []byte) error {
v := &addressJSON{}
err := json.Unmarshal(b, v)
Copy link
Copy Markdown
Contributor

@akrem-chabchoub akrem-chabchoub Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ?

Copy link
Copy Markdown
Contributor Author

@sbackend123 sbackend123 Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove backwards compatibility code to clean up codebase

5 participants