Tags: decred/politeia
Tags
tstore: Freeze trillian trees. This commit adds episodic checks to the tstore backend that freeze any trillian trees for records that have been updated to a status that no longer allows updates, such as censored or archived, and that have a final dcr timestamp appended onto the tree. The reason we need this requires some background knowledge on the trillian architecture. The trillian_log_signer polls the MySQL database at a fixed interval, looking for leaves that have been queued up and are waiting to be appended onto a tree. It does this for all trees that have an ACTIVE status. Trillian was designed to be used for a small number of trees that have infrequent writes, but that can get very large over time. The recommended log_signer_interval, i.e. the polling interval, was 2-3 seconds. The way we use trillian is quite different from it's intended use case and you see this reflected in the performance of trillian on our servers. We set the log signer interval to 200ms because we require the leaves be appended onto a tree in order for a write to be considered valid. We also use a new tree for each record. This results in a large number of trees that get polled by the log signer every 200ms and is why the CPUs spin on our servers. Moving the status of trees that can no longer be modified to FROZEN will help reduce this load.
ticketvote: Cast vote error format. This commit changes the ErrorCode field in the CastVoteReply structs to a pointer, in order to fix a bug where default error code value ErrorCodeInvalid was returned on success. After this, in case of success the error code pointer will be nil.