Open thedavidmeister opened 6 years ago
Yes, this is true. They get a sequence value from the iota
, and they actually are very sensitive because they implicitly part of the line protocol as remote nodes use the values to figure out which network action is meant. In a way the current tests which use "%v" to print out the values of a packet actually do test this correctly in that they make your code break if you change the ordering. They just don't do so explicitly so that you know what happened.
there are explicit tests in #698 at least for these consts
Noticed in #698
In
node.go
the constants are grouped by purpose, e.g. "DHT messages", "Validate messages", etc.But the value of the constants is determined by their ordering.
For example, adding
MIGRATE_REQUEST
beforePUT_REQUEST
causes tests to fail due toPUT_REQUEST
changing from2
to3
.Most of the constants have no tests ensuring their value, so a change of order can accidentally revalue some or all the constants.
These constants should ideally not be changing across versions.