Skip to content
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

network/records: change subnets type to [128]byte #1813

Open
wants to merge 3 commits into
base: stage
Choose a base branch
from

Conversation

nkryuchkov
Copy link
Contributor

The current handling of records is very error-prone and causes bugs like #1802. The code always expects subnets to be 128 byte long, so we can use [128]byte type instead of []byte

@nkryuchkov nkryuchkov changed the title network/records: change subnets type to [commons.SubnetsCount]byte network/records: change subnets type to [128]byte Oct 22, 2024
Copy link
Contributor

@iurii-ssv iurii-ssv left a comment

Choose a reason for hiding this comment

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

Mostly nits from me, definitely reads better with these changes.

network/peers/index.go Outdated Show resolved Hide resolved
network/peers/subnets.go Outdated Show resolved Hide resolved
network/records/subnets.go Outdated Show resolved Hide resolved
network/records/subnets.go Outdated Show resolved Hide resolved
network/records/subnets.go Outdated Show resolved Hide resolved
network/p2p/p2p.go Outdated Show resolved Hide resolved
network/peers/subnets.go Show resolved Hide resolved
network/peers/subnets_test.go Outdated Show resolved Hide resolved
network/peers/conn_manager.go Outdated Show resolved Hide resolved
network/peers/conn_manager.go Outdated Show resolved Hide resolved
Copy link
Contributor

@iurii-ssv iurii-ssv left a comment

Choose a reason for hiding this comment

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

LGTM

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.

2 participants