witnet-rust icon indicating copy to clipboard operation
witnet-rust copied to clipboard

Redundant fields in tally transaction

Open tmpolaczyk opened this issue 4 years ago • 0 comments

As of PR #1267 there are two fields in TallyTransaction that look redundant, we should be able to implicitly calculate them:

out_of_consensus and error_committers

message TallyTransaction {
    Hash dr_pointer = 1;
    bytes tally = 2;
    repeated ValueTransferOutput outputs = 3;
    repeated PublicKeyHash out_of_consensus = 4;
    repeated PublicKeyHash error_committers = 5;
}

Potential size savings: 20 bytes * number_of_out_of_consensus_and_errors per tally transaction.

Alternatives: since the reveals have a well known ordering, we could just store the reveal_index instead of PublicKeyHash. This would reduce the overhead from 20 bytes to ~1 byte, but not sure if we can easily implement that in the node.

tmpolaczyk avatar Jun 08 '20 15:06 tmpolaczyk