Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Makefile converted from justfile

# Get signal slot for a signal and sender
# Usage: make get-signal-slot signal=<signal> sender=<sender>
Comment on lines +1 to +4
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Add default all goal and test target; update PHONY to satisfy checkmake and typical expectations

Static analysis flagged missing “all” and “test” phony targets. Also set a sensible default goal.

 # Makefile converted from justfile
+
+.DEFAULT_GOAL := all
+
+all: compile
@@
-# Default target
-.PHONY: get-signal-slot create-sample-signal-proof create-sample-deposit-proof compile clean
+# Default targets
+test:
+	forge test -vvv
+
+.PHONY: all test get-signal-slot create-sample-signal-proof create-sample-deposit-proof compile clean

If you prefer not to define a test target here, we can suppress the checkmake rule instead—confirm your preference.

Also applies to: 20-25


🏁 Script executed:

#!/bin/bash
# Display the first 20 lines of the Makefile to verify existing goals and PHONY targets
if [ -f Makefile ]; then
  sed -n '1,20p' Makefile
else
  echo "Makefile not found in the repository root."
fi

Length of output: 641


🏁 Script executed:

#!/bin/bash
# Check for existing .PHONY declarations
echo "Lines with .PHONY:"
grep -n '^\.PHONY' Makefile || echo "No .PHONY target defined"

echo
echo "Full Makefile content (first 200 lines):"
sed -n '1,200p' Makefile

Length of output: 1049


Add a default all goal and a test target to Makefile
The Makefile currently defaults to the first target (get-signal-slot) and lacks a test target. Defining a sensible default and including test will satisfy checkmake and common expectations.

• File: Makefile
– Insert at top (after the header comment):
```makefile
.DEFAULT_GOAL := all

all: compile

test:
	forge test -vvv
```

– Update the existing .PHONY: line (currently on line 25) to include all and test:
diff # Default target -.PHONY: get-signal-slot create-sample-signal-proof create-sample-deposit-proof compile clean +.PHONY: all test get-signal-slot create-sample-signal-proof create-sample-deposit-proof compile clean

🤖 Prompt for AI Agents
In Makefile lines 1 to 4, add a default goal by inserting '.DEFAULT_GOAL := all'
and define an 'all' target that depends on 'compile' at the top after the header
comment. Also, add a 'test' target that runs 'forge test -vvv'. Then, update the
existing .PHONY declaration around line 25 to include 'all' and 'test' as phony
targets.

get-signal-slot:
cargo run --bin signal_slot $(signal) $(sender)

Comment on lines +5 to +7
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix Cargo arg parsing: pass positional args after --

Without --, Cargo may treat $(signal)/$(sender) as Cargo flags, breaking the command.

 get-signal-slot:
-	cargo run --bin signal_slot $(signal) $(sender)
+	cargo run --bin signal_slot -- $(signal) $(sender)
🤖 Prompt for AI Agents
In the Makefile at lines 5 to 7, the cargo run command passes positional
arguments $(signal) and $(sender) without using `--`, causing Cargo to
misinterpret them as flags. Fix this by adding `--` before the positional
arguments in the command line to ensure Cargo treats them correctly as arguments
to the binary.

# Create a sample signal proof
create-sample-signal-proof:
cargo run --bin sample_signal_proof > test/SignalService/SampleProof.t.sol

Comment on lines +8 to +11
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Make proof target idempotent: ensure output dir exists

Create the directory before redirecting, or the redirect will fail on a clean checkout.

 create-sample-signal-proof:
-	cargo run --bin sample_signal_proof > test/SignalService/SampleProof.t.sol
+	mkdir -p test/SignalService
+	cargo run --bin sample_signal_proof > test/SignalService/SampleProof.t.sol
🤖 Prompt for AI Agents
In the Makefile at lines 8 to 11, the create-sample-signal-proof target
redirects output to a file in a directory that may not exist, causing failure on
a clean checkout. Modify the target to first create the output directory
(test/SignalService) if it does not exist before running the cargo command and
redirecting output. This ensures the target is idempotent and will not fail due
to missing directories.

# Create a sample deposit proof
create-sample-deposit-proof:
cargo run --bin sample_deposit_proof > test/ETHBridge/SampleDepositProof.t.sol

Comment on lines +12 to +15
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Same here—ensure ETHBridge test dir exists before redirect

 create-sample-deposit-proof:
-	cargo run --bin sample_deposit_proof > test/ETHBridge/SampleDepositProof.t.sol
+	mkdir -p test/ETHBridge
+	cargo run --bin sample_deposit_proof > test/ETHBridge/SampleDepositProof.t.sol
🤖 Prompt for AI Agents
In the Makefile around lines 12 to 15, the target create-sample-deposit-proof
redirects output to test/ETHBridge/SampleDepositProof.t.sol without ensuring the
ETHBridge directory exists. Modify the target to first create the test/ETHBridge
directory if it does not exist before running the cargo command and redirecting
output, to prevent errors due to missing directories.

# Compile with forge
compile:
forge build --build-info --extra-output storage-layout
Comment on lines +16 to +18
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Incorrect forge extra-output key: use storageLayout (camelCase), not storage-layout

Solc’s JSON output selector is storageLayout; hyphenated form won’t be recognized.

 compile:
-	forge build --build-info --extra-output storage-layout
+	forge build --build-info --extra-output storageLayout
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Compile with forge
compile:
forge build --build-info --extra-output storage-layout
# Compile with forge
compile:
forge build --build-info --extra-output storageLayout
🤖 Prompt for AI Agents
In the Makefile at lines 16 to 18, the forge build command uses an incorrect
extra-output key `storage-layout`. Replace `storage-layout` with the correct
camelCase key `storageLayout` to match solc’s JSON output selector and ensure
proper recognition.


# Clean build artifacts
clean:
rm -rf out abis cache* && forge clean

# Default target
.PHONY: get-signal-slot create-sample-signal-proof create-sample-deposit-proof compile clean
11 changes: 0 additions & 11 deletions justfile

This file was deleted.

66 changes: 66 additions & 0 deletions scripts/DeployMinimalL1.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;

import {BlobRefRegistry} from "../src/blobs/BlobRefRegistry.sol";
import {IBlobRefRegistry} from "../src/blobs/IBlobRefRegistry.sol";
import {CheckpointTracker} from "../src/protocol/CheckpointTracker.sol";

import {ILookahead} from "../src/protocol/ILookahead.sol";
import {IProposerFees} from "../src/protocol/IProposerFees.sol";
import {TaikoInbox} from "../src/protocol/taiko_alethia/TaikoInbox.sol";

Comment on lines +5 to +11
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Remove unused imports to avoid compiler warnings

IBlobRefRegistry, ILookahead, and IProposerFees are unused.

 import {BlobRefRegistry} from "../src/blobs/BlobRefRegistry.sol";
-import {IBlobRefRegistry} from "../src/blobs/IBlobRefRegistry.sol";
 import {CheckpointTracker} from "../src/protocol/CheckpointTracker.sol";
 
-import {ILookahead} from "../src/protocol/ILookahead.sol";
-import {IProposerFees} from "../src/protocol/IProposerFees.sol";
 import {TaikoInbox} from "../src/protocol/taiko_alethia/TaikoInbox.sol";

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In scripts/DeployMinimalL1.s.sol around lines 5 to 11, the imports
IBlobRefRegistry, ILookahead, and IProposerFees are not used anywhere in the
file. Remove these three unused import statements to prevent compiler warnings
and keep the code clean.

import {SignalService} from "../src/protocol/SignalService.sol";
import {MockVerifier} from "../test/mocks/MockVerifier.sol";

import {Script} from "../lib/forge-std/src/Script.sol";
import {console} from "../lib/forge-std/src/console.sol";

/// @title Deploy L1 Taiko Contracts
/// @notice Script to deploy the TaikoInbox contract
contract DeployL1Contracts is Script {
function run() public {
vm.startBroadcast();

// --- config params ----
address lookaheadAddr = vm.envOr("TAIKO_LOOKAHEAD_ADDRESS", address(0));
uint256 maxAnchorBlockIdOffset = vm.envOr("TAIKO_MAX_ANCHOR_BLOCK_ID_OFFSET", uint256(100));
uint256 inclusionDelay = vm.envOr("TAIKO_INCLUSION_DELAY", uint256(1 hours));
bytes32 genesis = vm.envOr("TAIKO_GENESIS_HASH", keccak256(abi.encode("genesis")));

console.log("------- CONFIG ------");
console.log("Lookahead address:", lookaheadAddr);
console.log("Max Anchor Block Id Offset:", maxAnchorBlockIdOffset);
console.log("Inclusion Delay:", inclusionDelay);
console.log("Genesis:", genesis);
console.log("------------------------");

// ------deployments--------
BlobRefRegistry blobRefRegistry = new BlobRefRegistry();
TaikoInbox taikoInbox = new TaikoInbox(
lookaheadAddr, address(blobRefRegistry), maxAnchorBlockIdOffset, inclusionDelay
);

MockVerifier verifier = new MockVerifier();

SignalService signalService = new SignalService();

CheckpointTracker tracker = new CheckpointTracker(
genesis,
address(taikoInbox),
address(verifier),
address(signalService)
);

vm.stopBroadcast();

console.log("");
console.log("------- DEPLOYMENTS ------");
console.log("TaikoInbox deployed at:", address(taikoInbox));
console.log("CheckpointTracker deployed at:", address(tracker));
console.log("BlobRefRegistry address:", address(blobRefRegistry));
console.log("SignalService address:", address(signalService));
console.log("------------------------");


}
}