Commit c2f290d4 authored by AaronS's avatar AaronS Committed by GitHub

op-challenger: fix the wrong variable name and some additional fix (#11179)

* fix from differential-testing

* fix from L2Genesis

* fix variable name

* Update metrics.go
parent 4268a509
...@@ -4,7 +4,7 @@ import ( ...@@ -4,7 +4,7 @@ import (
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
) )
const ConstractSubsystem = "contracts" const ContractsSubsystem = "contracts"
type EndTimer func() type EndTimer func()
...@@ -28,7 +28,7 @@ func MakeContractMetrics(ns string, factory Factory) *ContractMetrics { ...@@ -28,7 +28,7 @@ func MakeContractMetrics(ns string, factory Factory) *ContractMetrics {
return &ContractMetrics{ return &ContractMetrics{
ContractRequestsTotal: factory.NewCounterVec(prometheus.CounterOpts{ ContractRequestsTotal: factory.NewCounterVec(prometheus.CounterOpts{
Namespace: ns, Namespace: ns,
Subsystem: ConstractSubsystem, Subsystem: ContractsSubsystem,
Name: "requests_total", Name: "requests_total",
Help: "Total requests to the contracts", Help: "Total requests to the contracts",
}, []string{ }, []string{
...@@ -36,7 +36,7 @@ func MakeContractMetrics(ns string, factory Factory) *ContractMetrics { ...@@ -36,7 +36,7 @@ func MakeContractMetrics(ns string, factory Factory) *ContractMetrics {
}), }),
ContractRequestDurationSeconds: factory.NewHistogramVec(prometheus.HistogramOpts{ ContractRequestDurationSeconds: factory.NewHistogramVec(prometheus.HistogramOpts{
Namespace: ns, Namespace: ns,
Subsystem: ConstractSubsystem, Subsystem: ContractsSubsystem,
Name: "requests_duration_seconds", Name: "requests_duration_seconds",
Help: "Histogram of contract request durations", Help: "Histogram of contract request durations",
}, []string{ }, []string{
......
...@@ -463,13 +463,13 @@ contract L2Genesis is Deployer { ...@@ -463,13 +463,13 @@ contract L2Genesis is Deployer {
vm.resetNonce(address(eas)); vm.resetNonce(address(eas));
} }
/// @notice This predeploy is following the saftey invariant #2. /// @notice This predeploy is following the safety invariant #2.
/// This contract has no initializer. /// This contract has no initializer.
function setCrossL2Inbox() internal { function setCrossL2Inbox() internal {
_setImplementationCode(Predeploys.CROSS_L2_INBOX); _setImplementationCode(Predeploys.CROSS_L2_INBOX);
} }
/// @notice This predeploy is following the saftey invariant #2. /// @notice This predeploy is following the safety invariant #2.
/// This contract has no initializer. /// This contract has no initializer.
function setL2ToL2CrossDomainMessenger() internal { function setL2ToL2CrossDomainMessenger() internal {
_setImplementationCode(Predeploys.L2_TO_L2_CROSS_DOMAIN_MESSENGER); _setImplementationCode(Predeploys.L2_TO_L2_CROSS_DOMAIN_MESSENGER);
......
...@@ -365,17 +365,17 @@ func DiffTestUtils() { ...@@ -365,17 +365,17 @@ func DiffTestUtils() {
panic("Error: cannonMemoryProofWithProof requires 2 or 4 arguments") panic("Error: cannonMemoryProofWithProof requires 2 or 4 arguments")
} }
pc, err := strconv.ParseUint(args[1], 10, 32) pc, err := strconv.ParseUint(args[1], 10, 32)
checkErr(err, "Error decocding addr") checkErr(err, "Error decoding addr")
insn, err := strconv.ParseUint(args[2], 10, 32) insn, err := strconv.ParseUint(args[2], 10, 32)
checkErr(err, "Error decocding insn") checkErr(err, "Error decoding insn")
mem.SetMemory(uint32(pc), uint32(insn)) mem.SetMemory(uint32(pc), uint32(insn))
var insnProof, memProof [896]byte var insnProof, memProof [896]byte
if len(args) == 5 { if len(args) == 5 {
memAddr, err := strconv.ParseUint(args[3], 10, 32) memAddr, err := strconv.ParseUint(args[3], 10, 32)
checkErr(err, "Error decocding memAddr") checkErr(err, "Error decoding memAddr")
memValue, err := strconv.ParseUint(args[4], 10, 32) memValue, err := strconv.ParseUint(args[4], 10, 32)
checkErr(err, "Error decocding memValue") checkErr(err, "Error decoding memValue")
mem.SetMemory(uint32(memAddr), uint32(memValue)) mem.SetMemory(uint32(memAddr), uint32(memValue))
memProof = mem.MerkleProof(uint32(memAddr)) memProof = mem.MerkleProof(uint32(memAddr))
} }
...@@ -398,16 +398,16 @@ func DiffTestUtils() { ...@@ -398,16 +398,16 @@ func DiffTestUtils() {
panic("Error: cannonMemoryProofWrongLeaf requires 4 arguments") panic("Error: cannonMemoryProofWrongLeaf requires 4 arguments")
} }
pc, err := strconv.ParseUint(args[1], 10, 32) pc, err := strconv.ParseUint(args[1], 10, 32)
checkErr(err, "Error decocding addr") checkErr(err, "Error decoding addr")
insn, err := strconv.ParseUint(args[2], 10, 32) insn, err := strconv.ParseUint(args[2], 10, 32)
checkErr(err, "Error decocding insn") checkErr(err, "Error decoding insn")
mem.SetMemory(uint32(pc), uint32(insn)) mem.SetMemory(uint32(pc), uint32(insn))
var insnProof, memProof [896]byte var insnProof, memProof [896]byte
memAddr, err := strconv.ParseUint(args[3], 10, 32) memAddr, err := strconv.ParseUint(args[3], 10, 32)
checkErr(err, "Error decocding memAddr") checkErr(err, "Error decoding memAddr")
memValue, err := strconv.ParseUint(args[4], 10, 32) memValue, err := strconv.ParseUint(args[4], 10, 32)
checkErr(err, "Error decocding memValue") checkErr(err, "Error decoding memValue")
mem.SetMemory(uint32(memAddr), uint32(memValue)) mem.SetMemory(uint32(memAddr), uint32(memValue))
// Compute a valid proof for the root, but for the wrong leaves. // Compute a valid proof for the root, but for the wrong leaves.
...@@ -426,9 +426,9 @@ func DiffTestUtils() { ...@@ -426,9 +426,9 @@ func DiffTestUtils() {
fmt.Print(hexutil.Encode(packed[32:])) fmt.Print(hexutil.Encode(packed[32:]))
case "encodeScalarEcotone": case "encodeScalarEcotone":
basefeeScalar, err := strconv.ParseUint(args[1], 10, 32) basefeeScalar, err := strconv.ParseUint(args[1], 10, 32)
checkErr(err, "Error decocding basefeeScalar") checkErr(err, "Error decoding basefeeScalar")
blobbasefeeScalar, err := strconv.ParseUint(args[2], 10, 32) blobbasefeeScalar, err := strconv.ParseUint(args[2], 10, 32)
checkErr(err, "Error decocding blobbasefeeScalar") checkErr(err, "Error decoding blobbasefeeScalar")
encoded := eth.EncodeScalar(eth.EcotoneScalars{ encoded := eth.EncodeScalar(eth.EcotoneScalars{
BaseFeeScalar: uint32(basefeeScalar), BaseFeeScalar: uint32(basefeeScalar),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment