-
Notifications
You must be signed in to change notification settings - Fork 10
Add scripts needed for taiko-client #152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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> | ||||||||||||||
| get-signal-slot: | ||||||||||||||
| cargo run --bin signal_slot $(signal) $(sender) | ||||||||||||||
|
|
||||||||||||||
|
Comment on lines
+5
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix Cargo arg parsing: pass positional args after Without get-signal-slot:
- cargo run --bin signal_slot $(signal) $(sender)
+ cargo run --bin signal_slot -- $(signal) $(sender)🤖 Prompt for AI Agents |
||||||||||||||
| # 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||||||||||||||
| # 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||||||||||||||
| # Compile with forge | ||||||||||||||
| compile: | ||||||||||||||
| forge build --build-info --extra-output storage-layout | ||||||||||||||
|
Comment on lines
+16
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect forge extra-output key: use Solc’s JSON output selector is compile:
- forge build --build-info --extra-output storage-layout
+ forge build --build-info --extra-output storageLayout📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
| # 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 | ||||||||||||||
This file was deleted.
| 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Remove unused imports to avoid compiler warnings
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";
🤖 Prompt for AI Agents |
||
| 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("------------------------"); | ||
|
|
||
|
|
||
| } | ||
| } | ||
There was a problem hiding this comment.
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
allgoal andtesttarget; update PHONY to satisfy checkmake and typical expectationsStatic analysis flagged missing “all” and “test” phony targets. Also set a sensible default goal.
If you prefer not to define a
testtarget here, we can suppress the checkmake rule instead—confirm your preference.Also applies to: 20-25
🏁 Script executed:
Length of output: 641
🏁 Script executed:
Length of output: 1049
Add a default
allgoal and atesttarget to MakefileThe Makefile currently defaults to the first target (
get-signal-slot) and lacks atesttarget. Defining a sensible default and includingtestwill satisfy checkmake and common expectations.• File:
Makefile– Insert at top (after the header comment):
```makefile
.DEFAULT_GOAL := all
– Update the existing
.PHONY:line (currently on line 25) to includeallandtest: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