|
|
@@ -244,6 +244,7 @@ impl ValidatorState {
|
|
|
true
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/// Generate a block proposal for the current slot, containing all
|
|
|
/// unconfirmed transactions. Proposal extends the longest fork
|
|
|
/// chain the node is holding.
|
|
|
@@ -460,10 +461,22 @@ impl ValidatorState {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
// TODO: Check if proposal coin commitments already spent
|
|
|
let prop_cm_x: pallas::Base = lf.public_inputs[constants::PI_COMMITMENT_X_INDEX];
|
|
|
let prop_cm_y: pallas::Base = lf.public_inputs[constants::PI_COMMITMENT_Y_INDEX];
|
|
|
|
|
|
+ // validate that this coin is already published.
|
|
|
+ /*
|
|
|
+ let tree_root: MerkleNode = self.consensus.coins_tree.root(0).unwrap();
|
|
|
+ let prop_cm_root: pallas::Base = lf.public_inputs[constants::PI_COMMITMENT_ROOT];
|
|
|
+ if tree_root.inner() <= prop_cm_root {
|
|
|
+ error!("validation of tree root failed");
|
|
|
+ info!("tree_root: {:?}", tree_root.inner());
|
|
|
+ info!("prop_root: {:?}", prop_cm_root);
|
|
|
+ }
|
|
|
+ */
|
|
|
+
|
|
|
// Validate state transition against canonical state
|
|
|
// TODO: This should be validated against fork state
|
|
|
debug!("receive_proposal(): Starting state transition validation");
|