Skip to content

wire: Add SerializeSize to Message interface - #3746

Merged
davecgh merged 1 commit into
decred:masterfrom
jholdstock:serialize-size
Jul 25, 2026
Merged

wire: Add SerializeSize to Message interface#3746
davecgh merged 1 commit into
decred:masterfrom
jholdstock:serialize-size

Conversation

@jholdstock

Copy link
Copy Markdown
Member

Based on #3744

Add SerializeSize to the Message interface, and add an implementation of SerializeSize to every message which was missing one. Also update the tests of every message so that SerializeSize is exercised at least once.

@davecgh davecgh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR. I'll review this over the next couple of days since it's pretty large.

@davecgh davecgh added this to the 2.2.0 milestone Jul 24, 2026

@davecgh davecgh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm about 3/4 through this. Will finish reviewing the rest later. A few comments inline for now.

Comment thread wire/msgaddr.go Outdated
Comment thread wire/msgaddrv2.go Outdated
Comment thread wire/msgversion.go Outdated

@davecgh davecgh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I finished reviewing everything now. Nothing else to add over the existing comment. Looks good otherwise!

@jholdstock

Copy link
Copy Markdown
Member Author

Implemented your suggestion. Also moved maxNetAddressPayload and maxNetAddressPayloadV2 from funcs to constants because the pver param was never used, and its also more consistent with the rest of the max payload values.

@davecgh

davecgh commented Jul 25, 2026

Copy link
Copy Markdown
Member

Please rebase this over master and I'll get it merged.

Add SerializeSize to the Message interface, and add an implementation of
SerializeSize to every message which was missing one. Also update the
tests of every message so that SerializeSize is exercised at least once.
@davecgh
davecgh merged commit e51406d into decred:master Jul 25, 2026
32 checks passed
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