Skip to content

Commit 806f38c

Browse files
authored
Merge pull request #9 from tangle-network/daniel/upgrade-template
fix: update template following latest blueprint sdk
2 parents d4d2367 + 4d2f2a3 commit 806f38c

File tree

17 files changed

+214
-257
lines changed

17 files changed

+214
-257
lines changed

.github/workflows/ci.yml.liquid

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ jobs:
1919
- name: Checkout Code
2020
uses: actions/checkout@v4
2121

22-
- uses: dtolnay/rust-toolchain@nightly
22+
- name: Install Rust
23+
uses: actions-rs/toolchain@v1
2324
with:
24-
toolchain: nightly-2024-10-13
25+
toolchain: nightly-2025-10-20
2526
components: rustfmt
2627

2728
- name: Check Formatting
28-
run: cargo fmt -- --check
29+
run: cargo +nightly-2025-10-20 fmt -- --check
2930

3031
lint:
3132
timeout-minutes: 120
@@ -46,9 +47,10 @@ jobs:
4647
- name: Install Solidity Dependencies
4748
run: forge soldeer update -d
4849

49-
- uses: dtolnay/rust-toolchain@nightly
50+
- name: Install Rust
51+
uses: actions-rs/toolchain@v1
5052
with:
51-
toolchain: nightly-2024-10-13
53+
toolchain: nightly-2025-10-20
5254
components: clippy
5355

5456
- uses: swatinem/rust-cache@v2
@@ -82,9 +84,10 @@ jobs:
8284
- name: Install Solidity Dependencies
8385
run: forge soldeer update -d
8486

85-
- uses: dtolnay/rust-toolchain@nightly
87+
- name: Install Rust
88+
uses: actions-rs/toolchain@v1
8689
with:
87-
toolchain: nightly-2024-10-13
90+
toolchain: nightly-2025-10-20
8891
components: clippy
8992

9093
- uses: swatinem/rust-cache@v2

.github/workflows/verify-template.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
--define project-description="An example blueprint"
2323
--define project-homepage="https://tangle.tools"
2424
--define flakes=true
25-
--define docker=true
25+
--define container=true
2626
--define base-image="rustlang/rust:nightly"
2727
--define ci=true
2828
--define rust-ci=true
@@ -33,9 +33,12 @@ jobs:
3333
version: nightly
3434
- name: Show forge version
3535
run: forge --version
36-
- uses: dtolnay/rust-toolchain@stable
36+
- name: Install Rust
37+
uses: actions-rs/toolchain@v1
3738
with:
38-
toolchain: stable
39+
toolchain: nightly-2025-10-20
40+
- name: Install protobuf compiler
41+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
3942
- run: |
4043
cp -r $PROJECT_NAME ${{ runner.temp }}/
4144
cd ${{ runner.temp }}/$PROJECT_NAME

Cargo.toml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,20 @@ repository = "https://github.com/{{gh-username}}/{{project-name}}"
1010
readme = "README.md"
1111
categories = ["cryptography", "cryptography::cryptocurrencies"]
1212
keywords = ["tangle", "blueprint", "avs"]
13-
rust-version = "1.81"
13+
rust-version = "1.88"
1414

1515
[dependencies]
16-
# Gadget
17-
blueprint-sdk = { git = "https://github.com/tangle-network/gadget.git", default-features = false, features = ["std", "eigenlayer", "evm", "macros", "build"] }
16+
blueprint-sdk = { version = "0.1.0-alpha.19", default-features = false, features = ["std", "eigenlayer", "evm", "macros", "build", "testing"], git = "https://github.com/tangle-network/blueprint.git" }
1817
serde = { version = "1.0.208", features = ["derive"] }
18+
jsonrpc-core = { version = "18.0.0", default-features = false }
19+
jsonrpc-http-server = { version = "18.0.0", default-features = false }
20+
thiserror = { version = "2.0.17", default-features = false }
21+
reqwest = { version = "0.12.22", default-features = false }
22+
color-eyre = { version = "0.6", default-features = false }
1923

2024

2125
[build-dependencies]
22-
blueprint-sdk = { git = "https://github.com/tangle-network/gadget.git", default-features = false, features = ["std", "build"] }
26+
blueprint-sdk = { version = "0.1.0-alpha.19", default-features = false, features = ["std", "eigenlayer", "evm", "macros", "build", "testing"], git = "https://github.com/tangle-network/blueprint.git" }
2327

2428
[features]
2529
default = ["std"]

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ LABEL org.opencontainers.image.description="{{project-description}}"
2121
LABEL org.opencontainers.image.source="https://github.com/{{gh-username}}/{{project-name}}"
2222
LABEL org.opencontainers.image.licenses="MIT OR Apache-2.0"
2323

24-
ENV RUST_LOG="gadget=info"
24+
ENV RUST_LOG="blueprint_sdk=info"
2525
ENV BIND_ADDR="0.0.0.0"
2626
ENV BIND_PORT=9632
2727
ENV BLUEPRINT_ID=0

build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fn main() {
22
let contract_dirs: Vec<&str> = vec!["./contracts"];
3-
blueprint_sdk::build::utils::soldeer_update();
4-
blueprint_sdk::build::utils::build_contracts(contract_dirs);
3+
blueprint_sdk::build::soldeer_update();
4+
blueprint_sdk::build::build_contracts(contract_dirs);
55
}
Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,18 @@
11
// SPDX-License-Identifier: UNLICENSED
22
pragma solidity >=0.8.13;
33

4-
import "eigenlayer-middleware/src/libraries/BN254.sol";
5-
64
interface ITangleTaskManager {
75
// EVENTS
86
event NewTaskCreated(uint32 indexed taskIndex, Task task);
97

10-
event TaskResponded(
11-
TaskResponse taskResponse,
12-
TaskResponseMetadata taskResponseMetadata
13-
);
8+
event TaskResponded(TaskResponse taskResponse, TaskResponseMetadata taskResponseMetadata);
149

1510
event TaskCompleted(uint32 indexed taskIndex);
1611

17-
event TaskChallengedSuccessfully(
18-
uint32 indexed taskIndex,
19-
address indexed challenger
20-
);
21-
22-
event TaskChallengedUnsuccessfully(
23-
uint32 indexed taskIndex,
24-
address indexed challenger
25-
);
26-
2712
// STRUCTS
2813
struct Task {
29-
uint256 numberToBeSquared;
14+
// TODO: Replace your task params
15+
bytes message;
3016
uint32 taskCreatedBlock;
3117
// task submitter decides on the criteria for a task to be completed
3218
// note that this does not mean the task was "correctly" answered (i.e. the number was squared correctly)
@@ -44,36 +30,30 @@ interface ITangleTaskManager {
4430
// Can be obtained by the operator from the event NewTaskCreated.
4531
uint32 referenceTaskIndex;
4632
// This is just the response that the operator has to compute by itself.
47-
uint256 numberSquared;
33+
// TODO: Replace with your expected param following Task
34+
bytes message;
4835
}
4936

5037
// Extra information related to taskResponse, which is filled inside the contract.
5138
// It thus cannot be signed by operators, so we keep it in a separate struct than TaskResponse
5239
// This metadata is needed by the challenger, so we emit it in the TaskResponded event
5340
struct TaskResponseMetadata {
54-
uint32 taskResponsedBlock;
41+
uint32 taskRespondedBlock;
5542
bytes32 hashOfNonSigners;
5643
}
5744

5845
// FUNCTIONS
5946
// NOTE: this function creates new task.
6047
function createNewTask(
61-
uint256 numberToBeSquared,
48+
// TODO: Replace param following Task
49+
bytes calldata message,
6250
uint32 quorumThresholdPercentage,
6351
bytes calldata quorumNumbers
6452
) external;
6553

6654
/// @notice Returns the current 'taskNumber' for the middleware
6755
function taskNumber() external view returns (uint32);
6856

69-
// // NOTE: this function raises challenge to existing tasks.
70-
function raiseAndResolveChallenge(
71-
Task calldata task,
72-
TaskResponse calldata taskResponse,
73-
TaskResponseMetadata calldata taskResponseMetadata,
74-
BN254.G1Point[] memory pubkeysOfNonSigningOperators
75-
) external;
76-
7757
/// @notice Returns the TASK_RESPONSE_WINDOW_BLOCK
7858
function getTaskResponseWindowBlock() external view returns (uint32);
7959
}

contracts/src/TangleServiceManager.sol

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
// SPDX-License-Identifier: UNLICENSED
22
pragma solidity >=0.8.13;
33

4-
import "eigenlayer-contracts/src/contracts/libraries/BytesLib.sol";
54
import "contracts/src/ITangleTaskManager.sol";
6-
import "eigenlayer-middleware/src/ServiceManagerBase.sol";
5+
import "@eigenlayer-middleware/src/ServiceManagerBase.sol";
6+
import {IAllocationManager} from "@eigenlayer/contracts/interfaces/IAllocationManager.sol";
7+
import {IRewardsCoordinator} from "@eigenlayer/contracts/interfaces/IRewardsCoordinator.sol";
8+
import {ISlashingRegistryCoordinator} from
9+
"@eigenlayer-middleware/src/interfaces/ISlashingRegistryCoordinator.sol";
710

811
/**
912
* @title Primary entrypoint for procuring services from Hello.
1013
* @author Layr Labs, Inc.
1114
*/
1215
contract TangleServiceManager is ServiceManagerBase {
13-
using BytesLib for bytes;
14-
1516
ITangleTaskManager
1617
public immutable TangleTaskManager;
1718

@@ -27,15 +28,19 @@ contract TangleServiceManager is ServiceManagerBase {
2728
constructor(
2829
IAVSDirectory _avsDirectory,
2930
IRewardsCoordinator _rewardsCoordinator,
30-
IRegistryCoordinator _registryCoordinator,
31+
ISlashingRegistryCoordinator _registryCoordinator,
3132
IStakeRegistry _stakeRegistry,
33+
IPermissionController _permissionController,
34+
IAllocationManager _allocationManager,
3235
ITangleTaskManager _TangleTaskManager
3336
)
3437
ServiceManagerBase(
3538
_avsDirectory,
3639
_rewardsCoordinator,
3740
_registryCoordinator,
38-
_stakeRegistry
41+
_stakeRegistry,
42+
_permissionController,
43+
_allocationManager
3944
)
4045
{
4146
TangleTaskManager = _TangleTaskManager;

0 commit comments

Comments
 (0)