Add an UnbalancedMerkleTree primitive

The reasoning for it is documented with itself. The plan is to use it within
our header for committing to the DAG (allowing one header per epoch, yet
logarithmic proofs for any header within the epoch), the transactions
commitment (allowing logarithmic proofs of a transaction within a block,
without padding), and the events commitment (allowing logarithmic proofs of
unique events within a block, despite events not having a unique ID inherent).

This also defines transaction hashes and performs the necessary modifications
for transactions to be unique.
This commit is contained in:
Luke Parker
2025-03-04 04:00:05 -05:00
parent 352af85498
commit bfff823bf7
6 changed files with 333 additions and 11 deletions

View File

@@ -15,8 +15,8 @@ use serai_primitives::{
pub enum Call {
/// Set the keys for a validator set.
set_keys {
/// The network whose latest validator set is setting their keys.
network: ExternalNetworkId,
/// The validator set which is setting their keys.
validator_set: ExternalValidatorSet,
/// The keys being set.
key_pair: KeyPair,
/// The participants in the validator set who signed off on these keys.
@@ -31,8 +31,8 @@ pub enum Call {
},
/// Report a validator set's slashes onto Serai.
report_slashes {
/// The network whose retiring validator set is setting their keys.
network: ExternalNetworkId,
/// The validator set which is setting their keys.
validator_set: ExternalValidatorSet,
/// The slashes they're reporting.
slashes: SlashReport,
/// The signature confirming the validity of this slash report.