mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-02-26 10:55:41 +00:00
add some comments
This commit is contained in:
parent
15f3a7fe37
commit
58c4e16365
@ -906,17 +906,25 @@ op shrOp, inline = true, shift, num:
|
||||
|
||||
op sarOp, inline = true:
|
||||
let shiftLen = computation.stack.popInt().safeInt
|
||||
let num = cast[Int256](computation.stack.popInt())
|
||||
let x = computation.stack.popInt()
|
||||
#let num = cast[Int256](computation.stack.popInt())
|
||||
if shiftLen >= 256:
|
||||
if num.isNegative:
|
||||
#if num.isNegative:
|
||||
if cast[Int256](x).isNegative:
|
||||
push: cast[Uint256]((-1).i256)
|
||||
else:
|
||||
push: 0
|
||||
else:
|
||||
push: cast[Uint256](ashr(num, shiftLen))
|
||||
# ashr depends on nim-stint/#76
|
||||
# push: cast[Uint256](ashr(num, shiftLen))
|
||||
# while waiting for stint/#76 merged, we use this workaround
|
||||
push: (x shr shiftLen) or (((0-(x shr 255)) shl 1) shl (255-shiftLen))
|
||||
|
||||
op extCodeHash, inline = true:
|
||||
let address = computation.stack.popAddress()
|
||||
# this is very inefficient, it calls underlying
|
||||
# database too much, we can reduce it by implementing accounts
|
||||
# cache
|
||||
if not computation.vmState.readOnlyStateDB.accountExists(address):
|
||||
push: 0
|
||||
return
|
||||
|
@ -13,7 +13,13 @@
|
||||
# being mostly used for short-term regression prevention.
|
||||
func allowedFailingGeneralStateTest*(folder, name: string): bool =
|
||||
let allowedFailingGeneralStateTests = @[
|
||||
# conflicts between native int and big int.
|
||||
# gasFee calculation in modexp precompiled
|
||||
# contracts
|
||||
"modexp.json",
|
||||
# perhaps a design flaw with create/create2 opcode.
|
||||
# a conflict between balance checker and
|
||||
# static call context checker
|
||||
"create2noCash.json",
|
||||
]
|
||||
result = name in allowedFailingGeneralStateTests
|
||||
|
Loading…
x
Reference in New Issue
Block a user