Skip to content

Commit c147e63

Browse files
committed
address comments
1 parent f8e7de2 commit c147e63

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

core/vm/contracts.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,17 @@ func (c *bigModExp) Run(input []byte) ([]byte, error) {
611611
modLen = modLenBig.Uint64()
612612
inputLenOverflow = max(baseLenBig.BitLen(), expLenBig.BitLen(), modLenBig.BitLen()) > 64
613613
)
614+
615+
// Since the ZKVM is more compatible, EIP-7823 && EIP-7883 don't need this check anymore,
616+
// but still need it for EIP-2565 to be compatible with backward compatibility
617+
if c.eip2565 {
618+
// Check that all inputs are `u256` (32 - bytes) or less, revert otherwise
619+
var lenLimit = new(big.Int).SetInt64(32)
620+
if baseLenBig.Cmp(lenLimit) > 0 || expLenBig.Cmp(lenLimit) > 0 || modLenBig.Cmp(lenLimit) > 0 {
621+
return nil, errModexpUnsupportedInput
622+
}
623+
}
624+
614625
if len(input) > 96 {
615626
input = input[96:]
616627
} else {

params/protocol_params.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ const (
162162
Bls12381MapG1Gas uint64 = 5500 // Gas price for BLS12-381 mapping field element to G1 operation
163163
Bls12381MapG2Gas uint64 = 110000 // Gas price for BLS12-381 mapping field element to G2 operation
164164

165-
P256VerifyGas uint64 = 6900 // secp256r1 elliptic curve signature verifier gas price
165+
P256VerifyGas uint64 = 3450 // secp256r1 elliptic curve signature verifier gas price
166166

167167
// The Refund Quotient is the cap on how much of the used gas can be refunded. Before EIP-3529,
168168
// up to half the consumed gas could be refunded. Redefined as 1/5th in EIP-3529

0 commit comments

Comments
 (0)