fixes for the IPA testnet

upgrade to latest go-verkle

update go-verkle to get more fixes

simplify code by removing all stateless references (#25)

fix verkle proof test by enforcing values alignment to 32 bytes

remove unneeded KZG tag

fix the stateless test

Move AccessWitness into StateDB (#27)

* move AccessWitness into StateDB

* set Accesses in TxContext constructor

* Ensures that a statedb is initialized with a witness

* copy AccessWitness in StateDB.Copy.  use copied state in miner worker.commit.

* remove redundant line

Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>

Fix contract creation issue
This commit is contained in:
Guillaume Ballet
2021-11-04 20:45:43 +01:00
parent 719bf47354
commit 9f9c03a94c
12 changed files with 59 additions and 190 deletions

View File

@ -135,6 +135,7 @@ func (trie *VerkleTrie) Commit(onleaf LeafCallback) (common.Hash, int, error) {
}
}
// XXX onleaf hasn't been called
return trie.Hash(), commitCount, nil
}
@ -237,19 +238,19 @@ func ChunkifyCode(addr common.Address, code []byte) ([][32]byte, error) {
chunkCount++
}
chunks := make([][32]byte, chunkCount)
for i, chunk := range chunks {
for i := range chunks {
end := 31 * (i + 1)
if len(code) < end {
end = len(code)
}
copy(chunk[1:], code[31*i:end])
copy(chunks[i][1:], code[31*i:end])
for j := lastOffset; int(j) < len(code[31*i:end]); j++ {
if code[j] >= byte(PUSH1) && code[j] <= byte(PUSH32) {
j += code[j] - byte(PUSH1) + 1
lastOffset = (j + 1) % 31
}
}
chunk[0] = lastOffset
chunks[i][0] = lastOffset
}
return chunks, nil