From 408dbbc8a228a102d1f8acac83d14f6f692afa41 Mon Sep 17 00:00:00 2001 From: Andrew Raffensperger Date: Tue, 8 Oct 2024 01:50:27 -0700 Subject: [PATCH] minor --- contracts/GatewayFetcher.sol | 12 +++++------- contracts/nitro/NitroVerifier.sol | 2 +- contracts/nitro/UnfinalizedNitroVerifier.sol | 2 +- scripts/serve.ts | 3 ++- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/contracts/GatewayFetcher.sol b/contracts/GatewayFetcher.sol index c4d0a310..4616cb9a 100755 --- a/contracts/GatewayFetcher.sol +++ b/contracts/GatewayFetcher.sol @@ -8,8 +8,6 @@ library GatewayFetcher { // verifier execution is only constrainted by stack and gas // max outputs = 255 // TODO: this could be configurable during constructor? - // memory use doesn't really matter during view construction - // however it does matter uint256 constant MAX_OPS = 8192; // thrown if limits above are exceeded @@ -283,7 +281,7 @@ library GatewayFetcher { } function dup( GatewayRequest memory r, - uint8 back + uint256 back ) internal pure returns (GatewayRequest memory) { return r.push(back).addByte(OP_DUP); } @@ -294,7 +292,7 @@ library GatewayFetcher { } function swap( GatewayRequest memory r, - uint8 back + uint256 back ) internal pure returns (GatewayRequest memory) { return r.push(back).addByte(OP_SWAP); } @@ -306,13 +304,13 @@ library GatewayFetcher { function pushStack( GatewayRequest memory r, - uint8 i + uint256 i ) internal pure returns (GatewayRequest memory) { return r.push(i).addByte(OP_PUSH_STACK); } function pushOutput( GatewayRequest memory r, - uint8 i + uint256 i ) internal pure returns (GatewayRequest memory) { return r.push(i).addByte(OP_PUSH_OUTPUT); } @@ -446,7 +444,7 @@ library GatewayFetcher { function evalLoop( GatewayRequest memory r, uint8 flags, - uint8 back + uint256 back ) internal pure returns (GatewayRequest memory) { return r.push(back).addByte(OP_EVAL_LOOP).addByte(flags); } diff --git a/contracts/nitro/NitroVerifier.sol b/contracts/nitro/NitroVerifier.sol index 0cc47955..12af225a 100755 --- a/contracts/nitro/NitroVerifier.sol +++ b/contracts/nitro/NitroVerifier.sol @@ -40,7 +40,7 @@ contract NitroVerifier is AbstractVerifier { GatewayProof memory p = abi.decode(proof, (GatewayProof)); Node memory node = _rollup.getNode(p.nodeNum); if (p.nodeNum != nodeNum1) { - // it wasn't want we requested + // it wasn't what we requested Node memory node1 = _rollup.getNode(nodeNum1); // check if node is between latest and our window _checkWindow(node1.createdAtBlock, node.createdAtBlock); diff --git a/contracts/nitro/UnfinalizedNitroVerifier.sol b/contracts/nitro/UnfinalizedNitroVerifier.sol index 0bf62ac1..57e3b1e7 100755 --- a/contracts/nitro/UnfinalizedNitroVerifier.sol +++ b/contracts/nitro/UnfinalizedNitroVerifier.sol @@ -59,7 +59,7 @@ contract UnfinalizedNitroVerifier is AbstractVerifier { bytes32 confirmData = keccak256( abi.encodePacked(keccak256(p.rlpEncodedBlock), p.sendRoot) ); - require(confirmData == node.confirmData, 'Nitro: confirmData'); + require(confirmData == node.confirmData, 'UnfinalizedNitro: confirmData'); RLPReader.RLPItem[] memory v = RLPReader.readList(p.rlpEncodedBlock); bytes32 stateRoot = RLPReaderExt.strictBytes32FromRLP(v[3]); // see: rlp.ts: encodeRlpBlock() return diff --git a/scripts/serve.ts b/scripts/serve.ts index 91c5765c..8a3b4f53 100755 --- a/scripts/serve.ts +++ b/scripts/serve.ts @@ -19,12 +19,13 @@ import { Contract } from 'ethers/contract'; import { toUnpaddedHex } from '../src/utils.js'; // NOTE: you can use CCIPRewriter to test an existing setup against a local gateway! -// https://adraffy.github.io/ens-normalize.js/test/resolver.html#raffy.linea.eth.nb2hi4dthixs62dpnvss4ylooruxg5dvobuwiltdn5ws65lsm4xq.ccipr.eth +// [raffy] https://adraffy.github.io/ens-normalize.js/test/resolver.html#raffy.eth.nb2hi4dthixs62dpnvss4ylooruxg5dvobuwiltdn5ws62duoryc6.ccipr.eth // 1. bun serve lineaV1 // 2. https://adraffy.github.io/CCIPRewriter.sol/test/ // 3. enter name: "raffy.linea.eth" // 4. enter endpoint: "http://localhost:8000" // 5. click (Resolve) +// 6. https://adraffy.github.io/ens-normalize.js/test/resolver.html#raffy.eth.nb2hi4b2f4xwy33dmfwgq33toq5dqmbqgaxq.ccipr.eth let prefetch = false; const args = process.argv.slice(2).filter((x) => {