Skip to content

Commit a472064

Browse files
authored
Bump SP1Beefy (#370)
1 parent 7c62bbb commit a472064

File tree

5 files changed

+75
-64
lines changed

5 files changed

+75
-64
lines changed

docs/pages/developers/network/relayer.mdx

+29-18
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,23 @@ max_rpc_payload_size = 150000000
175175
# misuse can cause the rpc to be overloaded with queries
176176
# initial_height = 1000
177177

178-
# (Optional) Frequency in seconds to poll the chain
178+
# (Optional) Frequency in seconds to poll the chain
179179
# for new state machine update events
180180
# poll_interval = 10
181181

182+
# (Optional) Hyperbridge's consensus state id
183+
# Only add this if relaying to a solochain.
184+
# Relaying between solochains and parachains with the
185+
# same relayer instance is not supported.
186+
# For Paseo Testnet: PAS0
187+
# For Polkadot Mainnet: DOT0
188+
# consensus_state_id = "PAS0"
189+
182190
# Relayer config, required
183191
[relayer]
184-
# Define your profitability configuration.
192+
# Define your profitability configuration.
185193
# 0 -> 0% i.e relay all requests, even unprofitable ones.
186-
# 1 -> 1%. ie fees provided for requests must be
194+
# 1 -> 1%. ie fees provided for requests must be
187195
# profitable by at least 1%. etc.
188196
minimum_profit_percentage = 0
189197

@@ -195,23 +203,25 @@ withdrawal_frequency = 86400
195203
# defaults to $100
196204
minimum_withdrawal_amount = 100
197205

198-
# If not empty, tesseract will only deliver requests
206+
# If not empty, tesseract will only deliver requests
199207
# to the specified state-machines
200208
delivery_endpoints = [
201209
"EVM-11155111",
202210
"EVM-421614",
203211
"EVM-11155420",
204212
"EVM-84532",
205-
"EVM-97"
213+
"EVM-97",
214+
"SUBSTRATE-myid",
215+
"POLKADOT-2100"
206216
]
207217

208-
# (Optional)
218+
# (Optional)
209219
# If not empty, will filter requests to be delivered
210220
# by originating module identifier (eg contract address/pallet ids)
211221
# module_filter = []
212222

213-
# (Optional)
214-
# How frequently to retry unprofitable or
223+
# (Optional)
224+
# How frequently to retry unprofitable or
215225
# failed messages in seconds.
216226
# If this is value not supplied retries will not be enabled.
217227
# unprofitable_retry_frequency = 600
@@ -256,9 +266,9 @@ consensus_state_id = "ETH0"
256266

257267
# Etherscan api key for querying the
258268
# state machine's native token price.
259-
# Do note that ethereum and all
269+
# Do note that ethereum and all
260270
# its L2's use ETH as the native token
261-
# So they can all share the same key
271+
# So they can all share the same key
262272
#
263273
# Bsc on the other hand uses the BNB token
264274
# and would need its own API key from bscscan
@@ -268,7 +278,7 @@ etherscan_api_key = ""
268278
ismp_host = ""
269279

270280
# (Optional)
271-
# Maximum block range that should be used to query eth_getLogs
281+
# Maximum block range that should be used to query eth_getLogs
272282
# in a single rpc call. if this parameter is not supplied,
273283
# the range will not be split into smaller chunks
274284
# and will be queried at once. This might be needed
@@ -278,7 +288,7 @@ ismp_host = ""
278288
# hex-encoded private key for the relayer account on this chain
279289
signer = ""
280290

281-
# (Optional)
291+
# (Optional)
282292
# Maximum number of concurrent requests to be used for tx tracing.
283293
# If not supplied will trace entire tx batches at once.
284294
# This increases tracing speeds by tracing txs concurrently
@@ -287,20 +297,20 @@ signer = ""
287297
# If using an rpc provider, ensure that they support a
288298
# large number of `debug_traceCall` requests/sec.
289299
#
290-
# Note: if you use the same provider for all your endpoints
300+
# Note: if you use the same provider for all your endpoints
291301
# then a very high request/sec threshold is required (> 1000 / sec)
292302
#
293303
# eg 5 transactions would be traced concurrently on this client
294304
# tracing_batch_size = 5
295305

296-
# (Optional)
306+
# (Optional)
297307
# Percentage buffer to add to gas prices
298308
# to increase likelihood of the transactions
299309
# going through e.g 1%, 2%
300310
# gas_price_buffer = 1
301311

302312
# (Optional)
303-
# The execution client implementation,
313+
# The execution client implementation,
304314
# only Geth or Erigon are fully supported
305315
# The possible values: "Geth" | "Erigon"
306316
# If this field is not set, the default is "Geth"
@@ -312,7 +322,7 @@ signer = ""
312322
# misuse can cause the rpc to be overloaded with queries
313323
# initial_height = 1000
314324

315-
# (Optional) Frequency in seconds to poll the chain
325+
# (Optional) Frequency in seconds to poll the chain
316326
# for new state machine update events
317327
# poll_interval = 10
318328

@@ -333,6 +343,7 @@ hashing = "Blake2"
333343
rpc_ws = "ws://127.0.0.1:9944" # example endpoint
334344

335345
# The consensus state identifier for this chain on hyperbridge.
346+
# "PARA" for parachains
336347
consensus_state_id = "PARA"
337348

338349
# (Optional)
@@ -344,13 +355,13 @@ consensus_state_id = "PARA"
344355
# Unneeded if the chain uses unsigned extrinsics for pallet-ismp
345356
# signer = ""
346357

347-
# (Optional) Frequency in seconds to poll the chain
358+
# (Optional) Frequency in seconds to poll the chain
348359
# for new state machine update events
349360
# poll_interval = 10
350361

351362
# (Optional) initial height
352363
# This sets the height at which to start querying messages,
353-
# This exists for testing and development,
364+
# This exists for testing and development,
354365
# misuse can cause the rpc to be overloaded with queries
355366
# initial_height = 1000
356367
```

evm/lib/sp1-contracts

Submodule sp1-contracts updated 44 files

evm/script/DeployHostUpdates.s.sol

+38-38
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {BaseScript} from "./BaseScript.sol";
1111
import "../src/modules/HandlerV1.sol";
1212

1313
import {SP1Beefy} from "../src/consensus/SP1Beefy.sol";
14-
import {SP1Verifier} from "@sp1-contracts/v2.0.0/SP1VerifierPlonk.sol";
14+
import {SP1Verifier} from "@sp1-contracts/v4.0.0-rc.3/SP1VerifierGroth16.sol";
1515
import {SP1Beefy} from "../src/consensus/SP1Beefy.sol";
1616

1717
contract DeployScript is BaseScript {
@@ -20,44 +20,44 @@ contract DeployScript is BaseScript {
2020
function run() external {
2121
vm.startBroadcast(uint256(privateKey));
2222

23-
// SP1Verifier verifier = new SP1Verifier();
24-
// SP1Beefy consensusClient = new SP1Beefy(verifier);
23+
SP1Verifier verifier = new SP1Verifier();
24+
SP1Beefy consensusClient = new SP1Beefy(verifier);
2525

2626
// HandlerV1 handler = new HandlerV1();
27-
BeefyV1 consensusClient = new BeefyV1{salt: salt}();
28-
29-
if (host.toSlice().startsWith("ethereum".toSlice())) {
30-
HostParams memory params = EvmHost(ETHEREUM_HOST).hostParams();
31-
params.consensusClient = address(consensusClient);
32-
// params.handler = address(handler);
33-
EvmHost(ETHEREUM_HOST).updateHostParams(params);
34-
} else if (host.toSlice().startsWith("arbitrum".toSlice())) {
35-
HostParams memory params = EvmHost(ARBITRUM_HOST).hostParams();
36-
params.consensusClient = address(consensusClient);
37-
// params.handler = address(handler);
38-
EvmHost(ARBITRUM_HOST).updateHostParams(params);
39-
} else if (host.toSlice().startsWith("optimism".toSlice())) {
40-
HostParams memory params = EvmHost(OPTIMISM_HOST).hostParams();
41-
params.consensusClient = address(consensusClient);
42-
// params.handler = address(handler);
43-
EvmHost(OPTIMISM_HOST).updateHostParams(params);
44-
} else if (host.toSlice().startsWith("base".toSlice())) {
45-
HostParams memory params = EvmHost(BASE_HOST).hostParams();
46-
params.consensusClient = address(consensusClient);
47-
// params.handler = address(handler);
48-
EvmHost(BASE_HOST).updateHostParams(params);
49-
} else if (host.toSlice().startsWith("bsc".toSlice())) {
50-
HostParams memory params = EvmHost(BNB_HOST).hostParams();
51-
params.consensusClient = address(consensusClient);
52-
// params.handler = address(handler);
53-
EvmHost(BNB_HOST).updateHostParams(params);
54-
} else if (host.toSlice().startsWith("gnosis".toSlice())) {
55-
HostParams memory params = EvmHost(GNOSIS_HOST).hostParams();
56-
params.consensusClient = address(consensusClient);
57-
// params.handler = address(handler);
58-
EvmHost(GNOSIS_HOST).updateHostParams(params);
59-
} else {
60-
revert("Unknown Host");
61-
}
27+
// BeefyV1 consensusClient = new BeefyV1{salt: salt}();
28+
29+
// if (host.toSlice().startsWith("ethereum".toSlice())) {
30+
// HostParams memory params = EvmHost(ETHEREUM_HOST).hostParams();
31+
// params.consensusClient = address(consensusClient);
32+
// // params.handler = address(handler);
33+
// EvmHost(ETHEREUM_HOST).updateHostParams(params);
34+
// } else if (host.toSlice().startsWith("arbitrum".toSlice())) {
35+
// HostParams memory params = EvmHost(ARBITRUM_HOST).hostParams();
36+
// params.consensusClient = address(consensusClient);
37+
// // params.handler = address(handler);
38+
// EvmHost(ARBITRUM_HOST).updateHostParams(params);
39+
// } else if (host.toSlice().startsWith("optimism".toSlice())) {
40+
// HostParams memory params = EvmHost(OPTIMISM_HOST).hostParams();
41+
// params.consensusClient = address(consensusClient);
42+
// // params.handler = address(handler);
43+
// EvmHost(OPTIMISM_HOST).updateHostParams(params);
44+
// } else if (host.toSlice().startsWith("base".toSlice())) {
45+
// HostParams memory params = EvmHost(BASE_HOST).hostParams();
46+
// params.consensusClient = address(consensusClient);
47+
// // params.handler = address(handler);
48+
// EvmHost(BASE_HOST).updateHostParams(params);
49+
// } else if (host.toSlice().startsWith("bsc".toSlice())) {
50+
// HostParams memory params = EvmHost(BNB_HOST).hostParams();
51+
// params.consensusClient = address(consensusClient);
52+
// // params.handler = address(handler);
53+
// EvmHost(BNB_HOST).updateHostParams(params);
54+
// } else if (host.toSlice().startsWith("gnosis".toSlice())) {
55+
// HostParams memory params = EvmHost(GNOSIS_HOST).hostParams();
56+
// params.consensusClient = address(consensusClient);
57+
// // params.handler = address(handler);
58+
// EvmHost(GNOSIS_HOST).updateHostParams(params);
59+
// } else {
60+
// revert("Unknown Host");
61+
// }
6262
}
6363
}

evm/src/consensus/SP1Beefy.sol

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ contract SP1Beefy is IConsensusClient, ERC165 {
3232
using HeaderImpl for Header;
3333

3434
// SP1 verification key
35-
bytes32 public verificationKey = bytes32(0x0071ba110ada2601c43635dabd6abea7180d3132fd75df662cac13505ade1f5d);
35+
bytes32 public verificationKey = bytes32(0x004609733a0366baf52880d2a058a858c8c83479d4b1fca39c1a14666375419f);
3636

3737
// Sp1 verifier contract
3838
ISP1Verifier internal _verifier;
@@ -58,8 +58,8 @@ contract SP1Beefy is IConsensusClient, ERC165 {
5858
}
5959

6060
/*
61-
* @dev Given some opaque consensus proof, produce the new consensus state and newly finalized intermediate states.
62-
*/
61+
* @dev Given some opaque consensus proof, produce the new consensus state and newly finalized intermediate states.
62+
*/
6363
function verifyConsensus(
6464
bytes calldata encodedState,
6565
bytes calldata encodedProof

evm/test/SP1BeefyTest.sol

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
pragma solidity 0.8.20;
1616

1717
import "forge-std/Test.sol";
18-
import {SP1Verifier} from "@sp1-contracts/v3.0.0/SP1VerifierGroth16.sol";
18+
import {SP1Verifier} from "@sp1-contracts/v4.0.0-rc.3/SP1VerifierGroth16.sol";
1919
import {ISP1Verifier} from "@sp1-contracts/ISP1Verifier.sol";
2020

2121
import "../src/consensus/SP1Beefy.sol";
@@ -52,12 +52,12 @@ contract SP1BeefyTest is Test {
5252

5353
function testPolkadotVerifier() public view {
5454
bytes
55-
memory proof = hex"090690900a331610accb89fe31c04e9d4e0af42b9a99c946330fa6955af1254eb86aa8d3156ad94ef914c0f0901e9226264c7ebbd95145ec8e4a49dca2d348300d1fff3f19cd79389cd6fa52de5d8b0dfe2d60e5d53f7c706c0568c46dfc19c7bb232a951b01fc65f1360369a2ac0c50bbb41163127840d1dedc2e3f6ee98338bd59c7b81e8ea4f720ca1a2b9f7207e27ccb833c4965503a47e4fa62ea5e419555bfdd6421af119e05ad9e13adc643de98945d29f6a6b8d2a470a218e4a2abc9092b693618e7ecf7e780dbe7580bccfe2d5be334035c7ac5361d435cbc760c7896290f7b2b109a2dbe6c47e8401ab119a2da052fb3c0933f3e1669a59437bd8bc8dc157b";
55+
memory proof = hex"11b6a09d0602783a739ff23a34879d0f31c9742293407605ad35b2ab9f2112445436251c2929a1f895ee9c0a7185734a57da30feaa42de756ef44ac2383ad0146f525ed41ea56e5485fe3d329cec126256c2c19918560e93fea6e69d6c1287aba55359e020f8368e1be185cabcaf87407e6e700be708bb4f0e3d800fea43e7e06f95d8a7141f29d97bbdec0ead4c051dc1a8ff931bf470e7f48bf8edba580d1a1e7f93bf2c7fc4b3124ccbbcaa0cb0243a3be77001d71fc4eb020bfce79d88ce520a9cf611b8032714b5f7429e0bd89c76474f67e0b8f02c0a1cc9fd3cbc8fdf6039a89904236d309f7153c388b5c66d5e5bdc484f4272b71aa246b121bbac05fd50bbe5";
5656

5757
bytes
58-
memory publicInputs = hex"0000000000000000000000000000000000000000000000000000000000000020a2f65237d65bf11eaf9883b0c994bc18a95ab47b43b572d7aff843b432973c9b000000000000000000000000000000000000000000000000000000000000019068ac81e3764c16d937384d2efebff4111285fda59d98dde537b309aeb0832d9100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001e7cfa25980d95567aa5b02809fb9e3485b1c54296b3ff471a70d12ef5314edd1";
58+
memory publicInputs = hex"00000000000000000000000000000000000000000000000000000000000000209b5eebd2ca5ae7248ba20456bd8866e6a233ea23c4079303c5b19971f05c40c900000000000000000000000000000000000000000000000000000000000001f38055badaa1bf16bbbb8cd6fe066815bb9e1f23ae46d9641cb88d88aeff1b9569000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000016482008a0af7995d30781c057b8decb26eac6bcebf646283fe386a919b833822";
5959

60-
bytes32 verificationKey = bytes32(0x0071ba110ada2601c43635dabd6abea7180d3132fd75df662cac13505ade1f5d);
60+
bytes32 verificationKey = bytes32(0x004609733a0366baf52880d2a058a858c8c83479d4b1fca39c1a14666375419f);
6161

6262
ISP1Verifier(address(sp1)).verifyProof(verificationKey, publicInputs, proof);
6363

0 commit comments

Comments
 (0)