Skip to content

Conversation

@cce
Copy link
Contributor

@cce cce commented Sep 21, 2022

Draft of avoiding re-encoding proposals when relaying them, by keeping references to the original encoded transmittedPayload message and the unauthenticatedVote contained inside it.

@ghost
Copy link

ghost commented Sep 22, 2022

Do we need to check the proposal vote is correct? Assuming agreement isn't broken, the encoded message should always be the same.

@cce cce requested a review from yossigi September 22, 2022 16:16
@cce cce force-pushed the avoid-reencoding-proposal branch from b4a9466 to 7ab3950 Compare September 22, 2022 16:21
Copy link
Contributor

@icorderi icorderi left a comment

Choose a reason for hiding this comment

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

LGTM


unauthenticatedProposal
PriorVote unauthenticatedVote `codec:"pv"`
PriorVote msgp.Raw `codec:"pv"`
Copy link
Contributor

Choose a reason for hiding this comment

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

panic: msgpack decode error [pos 46]: cannot decode unsigned integer: unrecognized descriptor byte: a4/string|bytes

goroutine 255 [running]:
github.com/algorand/go-algorand/agreement.(*testingNetwork).multicast(0xc0001b01c0, {0x1377d11, 0x2}, {0xc003436700, 0x319, 0x688}, 0x0, 0x0)
	/opt/cibuild/project/agreement/service_test.go:210 +0x1585
		if tag == protocol.ProposalPayloadTag {
			r := bytes.NewBuffer(data)

			var tp transmittedPayload
			err := protocol.DecodeStream(r, &tp)
			if err != nil {
				panic(err)
			}

Looks like it tries to decode pv field and gets only an encoded value and not encoded key-value pair?

@cce cce mentioned this pull request Oct 13, 2022
4 tasks
@cce
Copy link
Contributor Author

cce commented Oct 26, 2022

Can revisit later (would be good to also avoid re-compressing proposals when relaying them) after or as part of a consensus release

@cce cce closed this Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants