Skip to content

Add scripts needed for taiko-client#152

Closed
LeoPatOZ wants to merge 4 commits into
mainfrom
feat/client-scripts
Closed

Add scripts needed for taiko-client#152
LeoPatOZ wants to merge 4 commits into
mainfrom
feat/client-scripts

Conversation

@LeoPatOZ
Copy link
Copy Markdown
Contributor

@LeoPatOZ LeoPatOZ commented Aug 8, 2025

Summary by CodeRabbit

  • New Features

    • Added a deployment script to automate deploying core L1 protocol contracts with configurable parameters.
    • Introduced a Makefile with build and utility commands for easier project management.
  • Chores

    • Removed the previous task runner file to consolidate build and utility commands into the new Makefile.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 8, 2025

Walkthrough

A new Makefile replaces the previous justfile, providing build and utility targets for project management. Additionally, a new Solidity deployment script, DeployMinimalL1.s.sol, is introduced to automate the deployment of core L1 Taiko protocol contracts, reading configuration from environment variables and logging deployment details.

Changes

Cohort / File(s) Change Summary
Build System Migration
Makefile, justfile
Added a Makefile with build and utility targets, replacing the deleted justfile that previously defined similar tasks.
Deployment Script Addition
scripts/DeployMinimalL1.s.sol
Introduced a new Solidity script to deploy core L1 Taiko protocol contracts with configurable parameters and logging.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DeployL1Contracts (Script)
    participant Env
    participant BlobRefRegistry
    participant TaikoInbox
    participant MockVerifier
    participant SignalService
    participant CheckpointTracker
    participant Console

    User->>DeployL1Contracts: run()
    DeployL1Contracts->>Env: Read config parameters
    Env-->>DeployL1Contracts: Return parameters
    DeployL1Contracts->>BlobRefRegistry: Deploy
    DeployL1Contracts->>TaikoInbox: Deploy (with params)
    DeployL1Contracts->>MockVerifier: Deploy
    DeployL1Contracts->>SignalService: Deploy
    DeployL1Contracts->>CheckpointTracker: Deploy (with params)
    DeployL1Contracts->>Console: Log configuration and addresses
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

Hop, hop, a script anew,
Deploys the contracts, one, then two!
The Makefile’s here, the justfile’s gone,
With targets clear to build upon.
Solidity sings, deployments cheer—
The rabbit grins, for change is near!
🐇✨

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 116cb87 and 27840df.

📒 Files selected for processing (1)
  • scripts/DeployMinimalL1.s.sol (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/DeployMinimalL1.s.sol
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/client-scripts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🧹 Nitpick comments (6)
scripts/DeployMinimalL1.s.sol (6)

18-20: Docstring mismatch: script deploys multiple contracts, not just TaikoInbox

-/// @notice Script to deploy the TaikoInbox contract
+/// @notice Script to deploy a minimal set of Taiko L1 contracts

30-35: Log the genesis hash for reproducibility/debugging

Seeing the exact genesis used in a run is helpful when replaying deployments.

         console.log("Inclusion Delay:", inclusionDelay);
+        console.log("Genesis Hash:");
+        console.logBytes32(genesis);
         console.log("------------------------");

37-53: Label deployed contract addresses in the VM for clearer traces

Labels greatly improve readability in script traces and test logs without altering behavior.

         BlobRefRegistry blobRefRegistry = new BlobRefRegistry();
+        vm.label(address(blobRefRegistry), "BlobRefRegistry");
         TaikoInbox taikoInbox = new TaikoInbox(
             lookaheadAddr, address(blobRefRegistry), maxAnchorBlockIdOffset, inclusionDelay
         );
+        vm.label(address(taikoInbox), "TaikoInbox");
 
         MockVerifier verifier = new MockVerifier();
+        vm.label(address(verifier), "MockVerifier");
 
         SignalService signalService = new SignalService();
+        vm.label(address(signalService), "SignalService");
 
         CheckpointTracker tracker = new CheckpointTracker(
             genesis,
             address(taikoInbox),
             address(verifier),
             address(signalService)
         );
+        vm.label(address(tracker), "CheckpointTracker");

55-61: Also log the MockVerifier address for completeness

         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("MockVerifier address:", address(verifier));
         console.log("------------------------");

25-29: Confirm whether zero lookaheadAddr is acceptable in your target environments

You default lookaheadAddr to address(0). Fine for local/dev, but likely undesirable in staging/prod. Consider requiring it to be set or gating by network.

If you want, I can add an environment gate (e.g., allow zero only when CHAIN_ID is a known dev network) or a require(lookaheadAddr != address(0), "...").


20-20: Optional: Align contract name with file name for consistency

If you intend to invoke it as forge script scripts/DeployMinimalL1.s.sol:DeployMinimalL1, rename the contract accordingly; otherwise consider renaming the file.

-contract DeployL1Contracts is Script {
+contract DeployMinimalL1 is Script {
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4fa3363 and 116cb87.

📒 Files selected for processing (3)
  • Makefile (1 hunks)
  • justfile (0 hunks)
  • scripts/DeployMinimalL1.s.sol (1 hunks)
💤 Files with no reviewable changes (1)
  • justfile
🧰 Additional context used
🪛 checkmake (0.2.2)
Makefile

[warning] 25-25: Missing required phony target "all"

(minphony)


[warning] 25-25: Missing required phony target "test"

(minphony)

Comment thread Makefile
Comment on lines +1 to +4
# Makefile converted from justfile

# Get signal slot for a signal and sender
# Usage: make get-signal-slot signal=<signal> sender=<sender>
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.

Comment thread Makefile
Comment on lines +5 to +7
get-signal-slot:
cargo run --bin signal_slot $(signal) $(sender)

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.

Comment thread Makefile
Comment on lines +8 to +11
# Create a sample signal proof
create-sample-signal-proof:
cargo run --bin sample_signal_proof > test/SignalService/SampleProof.t.sol

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.

Comment thread Makefile
Comment on lines +12 to +15
# Create a sample deposit proof
create-sample-deposit-proof:
cargo run --bin sample_deposit_proof > test/ETHBridge/SampleDepositProof.t.sol

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.

Comment thread Makefile
Comment on lines +16 to +18
# Compile with forge
compile:
forge build --build-info --extra-output storage-layout
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.

Comment on lines +5 to +11
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";

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.

@LeoPatOZ LeoPatOZ closed this Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant