mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 15:46:43 +00:00
* add KeccakCodeHash and CodeSize to StateAccount * update StateAccount marshalling logic * change emptyCodeHash to poseidon(nil) * purge StateAccount.hash * fix/disable failing tests * change keccak and poseidon hash order in StateAccount * fix lint * update l2trace account wrapper * update eth_getProof response type * fix eth_getProof response type * goimports * update the codehash computation * update the codehash test cases * go mod tidy * fix tests * use keccak instead of poseidon * update trace codehash field name * upgrade zktrie to 4.2 * trigger ci * update state account marshalling according to spec * improve generatorStats estimation * add comment * upgrade zktrie to 4.3 * go mod tidy * misc fixes * fix TestDump * fix snap sync tests * handle err in the codehash * fix tests in snapshot/generate_test.go * remove prevhash from state journal * add state_account_marshalling_test.go * goimports * add more tests --------- Co-authored-by: Ho Vei <noelwei@gmail.com> Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
23 lines
539 B
Go
23 lines
539 B
Go
package codehash
|
|
|
|
import (
|
|
"github.com/scroll-tech/go-ethereum/common"
|
|
"github.com/scroll-tech/go-ethereum/crypto"
|
|
"github.com/scroll-tech/go-ethereum/crypto/poseidon"
|
|
)
|
|
|
|
var EmptyPoseidonCodeHash common.Hash
|
|
var EmptyKeccakCodeHash common.Hash
|
|
|
|
func PoseidonCodeHash(code []byte) (h common.Hash) {
|
|
return poseidon.CodeHash(code)
|
|
}
|
|
|
|
func KeccakCodeHash(code []byte) (h common.Hash) {
|
|
return crypto.Keccak256Hash(code)
|
|
}
|
|
|
|
func init() {
|
|
EmptyPoseidonCodeHash = poseidon.CodeHash(nil)
|
|
EmptyKeccakCodeHash = crypto.Keccak256Hash(nil)
|
|
}
|