Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,6 @@ func (s *PublicBlockChainAPI) GetProof(ctx context.Context, address common.Addre
storageHash = types.EmptyRootHash
}
keccakCodeHash := state.GetKeccakCodeHash(address)
poseidonCodeHash := state.GetPoseidonCodeHash(address)
storageProof := make([]StorageResult, len(storageKeys))

// if we have a storageTrie, (which means the account exists), we can update the storagehash
Expand All @@ -701,7 +700,6 @@ func (s *PublicBlockChainAPI) GetProof(ctx context.Context, address common.Addre
} else {
// no storageTrie means the account does not exist, so the codeHash is the hash of an empty bytearray.
keccakCodeHash = codehash.EmptyKeccakCodeHash
poseidonCodeHash = codehash.EmptyPoseidonCodeHash
}

// create the proof for the storageKeys
Expand All @@ -723,17 +721,26 @@ func (s *PublicBlockChainAPI) GetProof(ctx context.Context, address common.Addre
return nil, proofErr
}

return &AccountResult{
Address: address,
AccountProof: toHexSlice(accountProof),
Balance: (*hexutil.Big)(state.GetBalance(address)),
KeccakCodeHash: keccakCodeHash,
PoseidonCodeHash: poseidonCodeHash,
CodeSize: hexutil.Uint64(state.GetCodeSize(address)),
Nonce: hexutil.Uint64(state.GetNonce(address)),
StorageHash: storageHash,
StorageProof: storageProof,
}, state.Error()
result := &AccountResult{
Address: address,
AccountProof: toHexSlice(accountProof),
Balance: (*hexutil.Big)(state.GetBalance(address)),
KeccakCodeHash: keccakCodeHash,
CodeSize: hexutil.Uint64(state.GetCodeSize(address)),
Nonce: hexutil.Uint64(state.GetNonce(address)),
StorageHash: storageHash,
StorageProof: storageProof,
}

if state.IsZktrie() {
if storageTrie != nil {
result.PoseidonCodeHash = state.GetPoseidonCodeHash(address)
} else {
result.PoseidonCodeHash = codehash.EmptyPoseidonCodeHash
}
}

return result, state.Error()
}

// GetHeaderByNumber returns the requested canonical block header.
Expand Down
2 changes: 1 addition & 1 deletion params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
const (
VersionMajor = 5 // Major version component of the current release
VersionMinor = 8 // Minor version component of the current release
VersionPatch = 32 // Patch version component of the current release
VersionPatch = 33 // Patch version component of the current release
VersionMeta = "mainnet" // Version metadata to append to the version string
)

Expand Down
Loading