Skip to content

Commit

Permalink
Address comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
td202 committed Jan 9, 2024
1 parent 1db5c9f commit f81c812
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions concordium-consensus/src/Concordium/KonsensusV1/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1283,23 +1283,25 @@ instance (Monad m, BlockHashVersionFor pv ~ 'BlockHashVersion1) => Merkle.Merkle
put bbRound
put bbEpoch
put (qcBlock bbQuorumCertificate)
let timestampBaker = optProof ["quasi", "meta", "bakerInfo", "timestampBaker"] . rawMerkle . runPut $ do
let biPath = ["quasi", "meta", "bakerInfo"]
let timestampBaker = optProof (biPath ++ ["timestampBaker"]) . rawMerkle . runPut $ do
put bbTimestamp
put bbBaker
let nonce = optProof ["quasi", "meta", "bakerInfo", "nonce"] . rawMerkle . encode $ bbNonce
let bakerInfo = optProof ["quasi", "meta", "bakerInfo"] [timestampBaker, nonce]
let qcPath = ["quasi", "meta", "certificatesHash", "quorumCertificate"]
let nonce = optProof (biPath ++ "nonce") . rawMerkle . encode $ bbNonce
let bakerInfo = optProof biPath [timestampBaker, nonce]
let chPath = ["quasi", "meta", "certificatesHash"]
let qcPath = chPath ++ ["quorumCertificate"]
qcMerkleProof <- Merkle.buildMerkleProof (open . (qcPath ++)) bbQuorumCertificate
let qcHash = optProof qcPath qcMerkleProof
let tfPath = ["quasi", "meta", "certificatesHash", "timeoutFinalization"]
let tfPath = chPath ++ ["timeoutFinalization"]
let tcPath = tfPath ++ ["timeoutCertificate"]
tcMerkleProof <- Merkle.buildMerkleProof (open . (tcPath ++)) bbTimeoutCertificate
let tcHash = optProof tcPath tcMerkleProof
let efePath = tfPath ++ ["epochFinalizationEntry"]
efeMerkleProof <- Merkle.buildMerkleProof (open . (efePath ++)) bbEpochFinalizationEntry
let efeHash = optProof efePath efeMerkleProof
let tfHash = optProof tfPath [tcHash, efeHash]
let certificatesHash = optProof ["quasi", "meta", "certificatesHash"] [qcHash, tfHash]
let certificatesHash = optProof chPath [qcHash, tfHash]
let blockMeta = optProof ["quasi", "meta"] [bakerInfo, certificatesHash]
let blockData = case bbDerivableHashes of
DerivableBlockHashesV1{..} ->
Expand Down

0 comments on commit f81c812

Please sign in to comment.