Nyzo techRelease notesNyzo 551: cycle transaction fix

Nyzo 551: cycle transaction fix

Nyzo version 551 (commit on GitHub) corrects an issue with cycle transaction registration. It also contains several inconsequential changes to improve the quality of the codebase.

This version affects primarily the verifier. It contains inconsequential changes that involve other run modes but do not affect their behavior significantly.

In the CycleTransactionManager.registerTransaction() method, two additional checks have been added before attempting to add a transaction to the map. The first, checking for an existing signature, prevents re-registration of a transaction already in the map. This is the most consequential change in this version, because such re-registration would cause signatures that had been collected for the existing transaction to be lost.

The second check provides proper feedback when the new transaction has an earlier timestamp than the existing transaction. This does not change the behavior of the method — the merge method already chooses the transaction with the later timestamp — but it does communicate the results of the registration process better.

RN_551 code 0

In the registerSignature() method, the return value of the Transaction.addSignature() method is now considered before marking that the transaction has been registered and the map has changed. Note, when reading the Transaction.addSignature() method, that a check is not performed to see if the transaction is already in the map. So, that method and this method will both return a value of true for a signature that is otherwise valid, even if that signature has been registered previously.

RN_551 code 1

In MeshListener, the underscore has been removed from several enumeration names. This is solely for consistency, and it is explained further below.

RN_551 code 2

In Message, similar enumeration name changes were also applied.

RN_551 code 3

In the MessageType enumeration, the reason for the name changes is apparent. Prior to the introduction of "V2" messages, none of the enumeration names contained underscores. Underscores are generally uncommon in Java identifiers. In the V2 messages, underscores were necessary to separate the numerical message value. When the FrozenEdgeBalanceListRequest_45 message type was added, an underscore was used, following the pattern of the NodeJoinResponseV2_44 message type above it. However, the underscore was inconsistent with most values in this enumeration. Underscores continued to be used for new messages in this part of the list, through MinimalBlockResponse_52. This issue was noted in a routine code review and corrected to reduce inconsistencies in the code base.

RN_551 code 4

Unused imports were removed from SeedTransactionManager.

RN_551 code 5

To simplify testing of cycle transactions on a testnet, the TestnetGenesisBlockCreator now generates the system's coins directly into the cycle account.

RN_551 code 6

The addSignature() method in the Transaction class now returns a value indicating whether the signature was added to a transaction.

RN_551 code 7

In Verifier, the process that retrieves and freezes the Genesis block now checks to ensure that the Genesis block is actually frozen.

RN_551 code 8

ClientTransactionUtil, CycleTransactionListCommand, and TransactionListResponse also contain MessageType enumeration value changes.

RN_551 code 9

In NyzoStringEncoder, a case has been added for the new Signature type, and the Micropay case has been moved to order all cases alphabetically.

RN_551 code 10

The new NyzoStringSignature class wraps a signature for use in a Nyzo string.

RN_551 code 11

The prefix sig_ is used for the new Signature Nyzo string type.

RN_551 code 12

In Sentinel, minor modifications have been implemented to ensure that the managed verifiers are properly loaded and accessible outside the typical sentinel initialization sequence.

RN_551 code 13

In WebUtil, a convenience method has been added for providing sender-data strings that are sanitized for use in HTML.

RN_551 code 14

In HtmlTag, a check has been added to ensure null entries are not added to the elements list.

RN_551 code 15