Skip to content

Commit

Permalink
op-challenger: fix the wrong variable name and some additional fix (#…
Browse files Browse the repository at this point in the history
…11179)

* fix from differential-testing

* fix from L2Genesis

* fix variable name

* Update metrics.go
  • Loading branch information
DeeADouble authored Jul 31, 2024
1 parent 4268a50 commit c2f290d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions op-challenger/game/fault/contracts/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/prometheus/client_golang/prometheus"
)

const ConstractSubsystem = "contracts"
const ContractsSubsystem = "contracts"

type EndTimer func()

Expand All @@ -28,15 +28,15 @@ func MakeContractMetrics(ns string, factory Factory) *ContractMetrics {
return &ContractMetrics{
ContractRequestsTotal: factory.NewCounterVec(prometheus.CounterOpts{
Namespace: ns,
Subsystem: ConstractSubsystem,
Subsystem: ContractsSubsystem,
Name: "requests_total",
Help: "Total requests to the contracts",
}, []string{
"method",
}),
ContractRequestDurationSeconds: factory.NewHistogramVec(prometheus.HistogramOpts{
Namespace: ns,
Subsystem: ConstractSubsystem,
Subsystem: ContractsSubsystem,
Name: "requests_duration_seconds",
Help: "Histogram of contract request durations",
}, []string{
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts-bedrock/scripts/L2Genesis.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -463,13 +463,13 @@ contract L2Genesis is Deployer {
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.
function setCrossL2Inbox() internal {
_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.
function setL2ToL2CrossDomainMessenger() internal {
_setImplementationCode(Predeploys.L2_TO_L2_CROSS_DOMAIN_MESSENGER);
Expand Down
20 changes: 10 additions & 10 deletions packages/contracts-bedrock/scripts/go-ffi/differential-testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,17 +365,17 @@ func DiffTestUtils() {
panic("Error: cannonMemoryProofWithProof requires 2 or 4 arguments")
}
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)
checkErr(err, "Error decocding insn")
checkErr(err, "Error decoding insn")
mem.SetMemory(uint32(pc), uint32(insn))

var insnProof, memProof [896]byte
if len(args) == 5 {
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)
checkErr(err, "Error decocding memValue")
checkErr(err, "Error decoding memValue")
mem.SetMemory(uint32(memAddr), uint32(memValue))
memProof = mem.MerkleProof(uint32(memAddr))
}
Expand All @@ -398,16 +398,16 @@ func DiffTestUtils() {
panic("Error: cannonMemoryProofWrongLeaf requires 4 arguments")
}
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)
checkErr(err, "Error decocding insn")
checkErr(err, "Error decoding insn")
mem.SetMemory(uint32(pc), uint32(insn))

var insnProof, memProof [896]byte
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)
checkErr(err, "Error decocding memValue")
checkErr(err, "Error decoding memValue")
mem.SetMemory(uint32(memAddr), uint32(memValue))

// Compute a valid proof for the root, but for the wrong leaves.
Expand All @@ -426,9 +426,9 @@ func DiffTestUtils() {
fmt.Print(hexutil.Encode(packed[32:]))
case "encodeScalarEcotone":
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)
checkErr(err, "Error decocding blobbasefeeScalar")
checkErr(err, "Error decoding blobbasefeeScalar")

encoded := eth.EncodeScalar(eth.EcotoneScalars{
BaseFeeScalar: uint32(basefeeScalar),
Expand Down

0 comments on commit c2f290d

Please sign in to comment.