Nyzo techRelease notesNyzo 575: v2 cycle tx commands

Nyzo 575: v2 cycle tx commands

Nyzo version 575 (commit on GitHub) modifies the client cycle transaction commands for blockchain version 2.

This version affects the client only.

When blockchain updates are made, the core code that handles processing of blocks and balance lists must retain knowledge of prior blockchain versions. While this is not necessary for verifiers that are building the blockchain, it is necessary for the client and for anyone wanting to use the code to work with the historical blockchain.

However, the client commands that interact with the cycle do not need legacy functionality. The blockchain has successfully updated to version 2, so client commands for versions less than 2 no longer have any usefulness.

This version updates the client commands for cycle transactions to support version 2 of the blockchain, replacing the commands for equivalent functionality in version 1 of the blockchain.

The changes in the Block class are inconsequential. Indentation was corrected, a line of whitespace was added to improve readability, and blockHeight was added to a print statement.

RN_575 code 0

A comment was added to MeshListener.

RN_575 code 1

In Transaction.getByteSize(), a confusing reassignment of size was eliminated to improve code readability.

RN_575 code 2

In ClientTransactionUtil.sendTransactionToLikelyBlockVerifiers(), the identifier and IP address are now displayed for null responses. Also, the wait for a block to be received is now limited to 30 seconds, and periodic feedback is now provided.

RN_575 code 3

The version 2 blockchain allows for a much simpler CycleTransactionListCommand. An in-cycle verifier key is no longer required to fetch pending transactions. Pending cycle transactions are now stored in the balance list. This command no longer accepts any arguments, so validation is no longer required.

RN_575 code 4

The command is not long running now, and the validation logic was eliminated.

RN_575 code 5

In CycleTransactionListCommand.run(), querying of the list of cycle transactions was removed.

RN_575 code 6

CycleTransactionListCommand now produces an immediate result, so it now uses a CommandTable to present the result. The table is made and headers are added. The BalanceList of the frozen edge is retrieved. An error is added if the balance list cannot be retrieved, and a notice is added if the balance list contains no pending cycle transactions.

The CycleTransactionManager is no longer used by the client, so the call to CycleTransactionManager.performMaintenance() was eliminated. All of the old code for building the output table from the local list was removed in favor of code that builds a table from the cycle transactions stored in the balance list.

RN_575 code 7

A notice is added with the height and distance from open edge of the balance list used. A row is added for each pending cycle transaction.

RN_575 code 8

A SimpleExecutionResult is returned from the CycleTransactionListCommand.run() method. This provides good support for both the web interface and API.

RN_575 code 9

The CycleTransactionListCommand.processResponse() method was used to register transactions from the TransactionListResponse. It is no longer needed.

RN_575 code 10

CycleTransactionListCommand.getTransactionList() was removed. Cycle transactions are now available as a consistently ordered list inside the balance list. CycleTransactionListCommand.numberOfYesVotes() provides the count of affirmative votes for each transaction. Verifiers may change their vote for a transaction at any time before approval, and affirmative and negative votes are both allowed.

RN_575 code 11

The blockHeight argument was removed from CycleTransactionSendCommand. Previously, cycle transactions were scheduled far in advance so that signatures could be collected and bundled with the transaction in the target block. Now, cycle transactions are included without signatures, and signatures are registered in later blocks.

RN_575 code 12

In CycleTransactionSendCommand.validate(), validation of blockHeight was removed.

RN_575 code 13

Removal of the blockHeight argument in CycleTransactionSendCommand.validate() caused later argument indices to shift back by one position.

RN_575 code 14

CycleTransactionSendCommand.run() now sends the transaction to likely block verifiers only, not to the entire cycle. The ClientTransactionUtil.suggestedTransactionTimestamp() method is the same method used to choose a timestamp for standard transactions.

RN_575 code 15

CycleTransactionSignCommand now accepts a transaction signature in lieu of an index. It also now accepts a vote, 1 to vote for the transaction or 0 to vote against the transaction. A vote against the transaction does not affect approval except when it is used to revoke a prior vote for the transaction.

RN_575 code 16

In CycleTransactionSignCommand.validate(), the transaction list is no longer needed, and the index is no longer provided. The signature is only checked to be a valid Nyzo signature string.

RN_575 code 17

The logic checking the signer key is unchanged. This is an indentation change.

RN_575 code 18

The vote is required to be 1 or 0. The transaction is no longer retrieved from a list, so transaction properties are no longer displayed.

RN_575 code 19

In CycleTransactionSignCommand.run(), the arguments are retrieved, the cycle-signature transaction is built, and the transaction is sent to likely verifiers. Like cycle transactions, cycle-signature transactions are now included in the blockchain immediately, so the transaction does not need to be sent to the entire cycle.

RN_575 code 20

A misspelling was corrected in SentinelController.

RN_575 code 21