Skip to content

Commit

Permalink
foobar
Browse files Browse the repository at this point in the history
  • Loading branch information
jwasinger committed Jan 20, 2022
1 parent 660ffc9 commit eff384d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
4 changes: 2 additions & 2 deletions core/chain_makers.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ func GenerateVerkleChain(config *params.ChainConfig, parent *types.Block, engine
}
}
vtr.Hash()
_, err := vtr.ProveAndSerialize(keys, statedb.Witness().KeyVals())
//block.SetVerkleProof(p)
p, err := vtr.ProveAndSerialize(keys, statedb.Witness().KeyVals())
block.SetVerkleProof(p)
if err != nil {
panic(err)
}
Expand Down
18 changes: 2 additions & 16 deletions trie/verkle.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,22 +191,8 @@ type verkleproof struct {
}

func (trie *VerkleTrie) ProveAndSerialize(keys [][]byte, kv map[common.Hash][]byte) ([]byte, error) {
proof, cis, indices, yis := verkle.MakeVerkleMultiProof(trie.root, keys)
vp := verkleproof{
Proof: proof,
Cis: cis,
Indices: indices,
Yis: yis,
}
for key, val := range kv {
var k [32]byte
copy(k[:], key[:])
vp.Leaves = append(vp.Leaves, KeyValuePair{
Key: k[:],
Value: val,
})
}
return rlp.EncodeToBytes(vp)
proof, _, _, _ := verkle.MakeVerkleMultiProof(trie.root, keys)
return verkle.SerializeProof(proof)
}

func DeserializeAndVerifyVerkleProof(serialized []byte) (map[common.Hash]common.Hash, error) {
Expand Down

0 comments on commit eff384d

Please sign in to comment.