Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
f640ef9
update dep to openvm 14 and fix issues after upgrade
noel2004 Sep 11, 2025
8fcd273
prune storage fetch in execution
noel2004 Sep 12, 2025
642ee2f
export new func with ffi
noel2004 Sep 12, 2025
e33d11d
apply features in configuration
noel2004 Sep 12, 2025
f3d1b15
fmt
noel2004 Sep 12, 2025
fcda68b
fix, e2e for 0.5.6 passed
noel2004 Sep 12, 2025
9998069
upgrade zkvm dep
noel2004 Sep 15, 2025
953ba50
update gpu building
noel2004 Sep 15, 2025
0d6eaf7
deprecate patch for gpu building
noel2004 Sep 15, 2025
755ed60
update toolchain for CI
noel2004 Sep 15, 2025
ab8df8e
trival update considering AI reviews
noel2004 Sep 16, 2025
25fd6aa
upgrade some deps
lispc Sep 16, 2025
722cc5e
fix gpu prover building and update build route
noel2004 Sep 16, 2025
53d7112
cargo check ok
lispc Sep 16, 2025
f6e6176
Merge branch 'feat/openvm_1.4' into feat/cloak
lispc Sep 16, 2025
ad13b56
clean up
noel2004 Sep 16, 2025
342c015
feat: handle versioning and validium tasks
roynalnaruto Sep 16, 2025
07ebd01
feat: add more arguments to task and metadata
roynalnaruto Sep 16, 2025
3663e51
feat: version byte to tasks
roynalnaruto Sep 16, 2025
e8e0472
test: add validium mode to test data
roynalnaruto Sep 16, 2025
416f1af
feat: handle decryption key and validium chunk task
roynalnaruto Sep 16, 2025
bae85be
Merge branch 'feat/openvm_1.4' into feat/cloak
roynalnaruto Sep 16, 2025
9c906a4
add missed cuda feature in building
noel2004 Sep 17, 2025
aacc0c0
prune gpu prover making
noel2004 Sep 17, 2025
9f125c9
fix: use codec v1 for validium encoding (#1739)
Thegaram Sep 17, 2025
f17c273
config for 0.6.0-rc.1
roynalnaruto Sep 17, 2025
3b40a6b
Merge remote-tracking branch 'origin/develop' into HEAD
lispc Sep 19, 2025
d2dd018
Merge branch 'feat/cloak' into HEAD
lispc Sep 19, 2025
c9ae48b
update local test staffs
noel2004 Sep 19, 2025
4977b3a
bump minor version
noel2004 Sep 19, 2025
99fe0a7
fix scroll_getL1MessagesInBlock call
Thegaram Sep 24, 2025
0b511d2
undo unrelated change
Thegaram Sep 24, 2025
6f282c4
handling null return in getL1message
noel2004 Sep 24, 2025
39f2d25
Avoiding encode entryption key
noel2004 Sep 24, 2025
58c8ca3
update e2e test generator
noel2004 Sep 25, 2025
76e9283
TaskProvingTask omit kzg part in validium mode
noel2004 Sep 25, 2025
b63e247
init verifier with version, fix pi hash checking in validium mode
noel2004 Sep 25, 2025
9c8782f
fix coordinator generate validium batch
noel2004 Sep 26, 2025
71b6c21
updated zkvm-prover dependencies
noel2004 Sep 26, 2025
45c343c
bump version
noel2004 Sep 26, 2025
e335366
Merge remote-tracking branch 'origin/develop' into feat/cloak
noel2004 Sep 26, 2025
6d9e525
patch for work around configuration issue
noel2004 Sep 29, 2025
d9fe2e0
fmt
noel2004 Sep 29, 2025
fb2ad50
bump version
noel2004 Sep 29, 2025
09ef1dd
fix(validium): use original l1 msg hash for msg queue hash (#1743)
Thegaram Sep 29, 2025
32a7398
sanity check for msg_queue_hash
noel2004 Sep 29, 2025
28a2173
lint
noel2004 Sep 29, 2025
6fa0f86
update dep
noel2004 Oct 1, 2025
38c4eff
fix: genesis state root commit workaround
Thegaram Oct 2, 2025
ac57b4f
fix
Thegaram Oct 2, 2025
252e9a0
fix issue in e2e test
noel2004 Oct 7, 2025
529ce6f
update e2e test staffs
noel2004 Oct 7, 2025
fe8211a
add chunk dumping script
noel2004 Oct 7, 2025
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
208 changes: 178 additions & 30 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ repository = "https://github.com/scroll-tech/scroll"
version = "4.5.47"

[workspace.dependencies]
scroll-zkvm-prover = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "060be4c" }
scroll-zkvm-verifier = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "060be4c" }
scroll-zkvm-types = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "060be4c" }
scroll-zkvm-prover = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "894441f" }
scroll-zkvm-verifier = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "894441f" }
scroll-zkvm-types = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "894441f" }

sbv-primitives = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "master", features = ["scroll", "rkyv"] }
sbv-utils = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "master" }
Expand Down
54 changes: 39 additions & 15 deletions common/types/message/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ const (

// ChunkTaskDetail is a type containing ChunkTask detail for chunk task.
type ChunkTaskDetail struct {
Version uint8 `json:"version"`
// use one of the string of "euclidv1" / "euclidv2"
ForkName string `json:"fork_name"`
BlockHashes []common.Hash `json:"block_hashes"`
PrevMsgQueueHash common.Hash `json:"prev_msg_queue_hash"`
PostMsgQueueHash common.Hash `json:"post_msg_queue_hash"`
}

// it is a hex encoded big with fixed length on 48 bytes
Expand Down Expand Up @@ -90,40 +92,60 @@ func (e *Byte48) UnmarshalJSON(input []byte) error {

// BatchTaskDetail is a type containing BatchTask detail.
type BatchTaskDetail struct {
Version uint8 `json:"version"`
// use one of the string of "euclidv1" / "euclidv2"
ForkName string `json:"fork_name"`
ChunkInfos []*ChunkInfo `json:"chunk_infos"`
ChunkProofs []*OpenVMChunkProof `json:"chunk_proofs"`
BatchHeader interface{} `json:"batch_header"`
BlobBytes []byte `json:"blob_bytes"`
KzgProof Byte48 `json:"kzg_proof,omitempty"`
KzgCommitment Byte48 `json:"kzg_commitment,omitempty"`
ChallengeDigest common.Hash `json:"challenge_digest,omitempty"`
ForkName string `json:"fork_name"`
ChunkInfos []*ChunkInfo `json:"chunk_infos"`
ChunkProofs []*OpenVMChunkProof `json:"chunk_proofs"`
BatchHeader interface{} `json:"batch_header"`
BlobBytes []byte `json:"blob_bytes"`
KzgProof *Byte48 `json:"kzg_proof,omitempty"`
KzgCommitment *Byte48 `json:"kzg_commitment,omitempty"`
// ChallengeDigest should be a common.Hash type if it is not nil
ChallengeDigest interface{} `json:"challenge_digest,omitempty"`
}

// BundleTaskDetail consists of all the information required to describe the task to generate a proof for a bundle of batches.
type BundleTaskDetail struct {
Version uint8 `json:"version"`
// use one of the string of "euclidv1" / "euclidv2"
ForkName string `json:"fork_name"`
BatchProofs []*OpenVMBatchProof `json:"batch_proofs"`
BundleInfo *OpenVMBundleInfo `json:"bundle_info,omitempty"`
}

type RawBytes []byte

func (r RawBytes) MarshalJSON() ([]byte, error) {
if r == nil {
return []byte("null"), nil
}
// Marshal the []byte as a JSON array of numbers
rn := make([]uint16, len(r))
for i := range r {
rn[i] = uint16(r[i])
}
return json.Marshal(rn)
}

// ChunkInfo is for calculating pi_hash for chunk
type ChunkInfo struct {
ChainID uint64 `json:"chain_id"`
PrevStateRoot common.Hash `json:"prev_state_root"`
PostStateRoot common.Hash `json:"post_state_root"`
WithdrawRoot common.Hash `json:"withdraw_root"`
DataHash common.Hash `json:"data_hash"`
IsPadding bool `json:"is_padding"`
TxBytes []byte `json:"tx_bytes"`
ChainID uint64 `json:"chain_id"`
PrevStateRoot common.Hash `json:"prev_state_root"`
PostStateRoot common.Hash `json:"post_state_root"`
WithdrawRoot common.Hash `json:"withdraw_root"`
DataHash common.Hash `json:"data_hash"`
IsPadding bool `json:"is_padding"`
// TxBytes []byte `json:"tx_bytes"`
TxBytesHash common.Hash `json:"tx_data_digest"`
PrevMsgQueueHash common.Hash `json:"prev_msg_queue_hash"`
PostMsgQueueHash common.Hash `json:"post_msg_queue_hash"`
TxDataLength uint64 `json:"tx_data_length"`
InitialBlockNumber uint64 `json:"initial_block_number"`
BlockCtxs []BlockContextV2 `json:"block_ctxs"`
PrevBlockhash common.Hash `json:"prev_blockhash"`
PostBlockhash common.Hash `json:"post_blockhash"`
EncryptionKey RawBytes `json:"encryption_key"`
}

// BlockContextV2 is the block context for euclid v2
Expand Down Expand Up @@ -186,6 +208,7 @@ type OpenVMBatchInfo struct {
ChainID uint64 `json:"chain_id"`
PrevMsgQueueHash common.Hash `json:"prev_msg_queue_hash"`
PostMsgQueueHash common.Hash `json:"post_msg_queue_hash"`
EncryptionKey RawBytes `json:"encryption_key"`
}

// BatchProof includes the proof info that are required for batch verification and rollup.
Expand Down Expand Up @@ -246,6 +269,7 @@ type OpenVMBundleInfo struct {
PrevBatchHash common.Hash `json:"prev_batch_hash"`
BatchHash common.Hash `json:"batch_hash"`
MsgQueueHash common.Hash `json:"msg_queue_hash"`
EncryptionKey RawBytes `json:"encryption_key"`
}

// OpenVMBundleProof includes the proof info that are required for verification of a bundle of batch proofs.
Expand Down
2 changes: 1 addition & 1 deletion common/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"runtime/debug"
)

var tag = "v4.5.47"
var tag = "v4.6.3"

var commit = func() string {
if info, ok := debug.ReadBuildInfo(); ok {
Expand Down
2 changes: 1 addition & 1 deletion coordinator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ coordinator_tool:

localsetup: coordinator_api ## Local setup: build coordinator_api, copy config, and setup releases
@echo "Copying configuration files..."
cp -r $(PWD)/conf $(PWD)/build/bin/
cp -r $(PWD)/conf/config.json $(PWD)/build/bin/conf/config.template.json
@echo "Setting up releases..."
cd $(PWD)/build && bash setup_releases.sh

Expand Down
1 change: 1 addition & 0 deletions coordinator/build/setup_releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ for ((i=0; i<$VERIFIER_COUNT; i++)); do
# assets for verifier-only mode
echo "Downloading assets for $FORK_NAME to $ASSET_DIR..."
wget https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/verifier/verifier.bin -O ${ASSET_DIR}/verifier.bin
wget https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/verifier/root_verifier_vk -O ${ASSET_DIR}/root_verifier_vk
wget https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/verifier/openVmVk.json -O ${ASSET_DIR}/openVmVk.json

echo "Completed downloading assets for $FORK_NAME"
Expand Down
2 changes: 1 addition & 1 deletion coordinator/cmd/tool/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func verify(cCtx *cli.Context) error {
return fmt.Errorf("error reading file: %w", err)
}

vf, err := verifier.NewVerifier(cfg.ProverManager.Verifier)
vf, err := verifier.NewVerifier(cfg.ProverManager.Verifier, cfg.L2.ValidiumMode)
if err != nil {
return err
}
Expand Down
16 changes: 8 additions & 8 deletions coordinator/conf/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@
"min_prover_version": "v4.4.45",
"verifiers": [
{
"assets_path": "assets",
"fork_name": "euclidV2"
},
{
"assets_path": "assets",
"assets_path": "cloak",
"fork_name": "feynman"
}
]
}
},
"db": {
"driver_name": "postgres",
"dsn": "postgres://localhost/scroll?sslmode=disable",
"dsn": "postgres://dev:dev@localhost/scroll?sslmode=disable",
"maxOpenNum": 200,
"maxIdleNum": 20
},
"l2": {
"chain_id": 111,
"validium_mode": true,
"chain_id": 5343513301,
"l2geth": {
"endpoint": "not need to specified for mocking"
"endpoint": "http://cloak-xen-sequencer.sepolia.scroll.tech:8545/"
}
},
"auth": {
"secret": "prover secret key",
"challenge_expire_duration_sec": 3600,
"login_expire_duration_sec": 3600
},
"sequencer": {
"decryption_key": "sequencer decryption key"
}
}
12 changes: 10 additions & 2 deletions coordinator/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ type L2Endpoint struct {
// L2 loads l2geth configuration items.
type L2 struct {
// l2geth chain_id.
ChainID uint64 `json:"chain_id"`
Endpoint *L2Endpoint `json:"l2geth"`
ChainID uint64 `json:"chain_id"`
Endpoint *L2Endpoint `json:"l2geth"`
ValidiumMode bool `json:"validium_mode"`
}

// Auth provides the auth coordinator
Expand All @@ -47,17 +48,24 @@ type Auth struct {
LoginExpireDurationSec int `json:"login_expire_duration_sec"`
}

// The sequencer controlled data
type Sequencer struct {
DecryptionKey string `json:"decryption_key"`
}

// Config load configuration items.
type Config struct {
ProverManager *ProverManager `json:"prover_manager"`
DB *database.Config `json:"db"`
L2 *L2 `json:"l2"`
Auth *Auth `json:"auth"`
Sequencer *Sequencer `json:"sequencer"`
}

// AssetConfig contain assets configurated for each fork, the defaul vkfile name is "OpenVmVk.json".
type AssetConfig struct {
AssetsPath string `json:"assets_path"`
Version uint8 `json:"version,omitempty"`
ForkName string `json:"fork_name"`
Vkfile string `json:"vk_file,omitempty"`
MinProverVersion string `json:"min_prover_version,omitempty"`
Expand Down
8 changes: 6 additions & 2 deletions coordinator/internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,17 @@ func TestConfig(t *testing.T) {
"maxIdleNum": 20
},
"l2": {
"chain_id": 111
"chain_id": 111,
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can rename "l2" to "sequencer" and move all configurations together. The "l2" here just indicate the corresponding sequencer.

"validium_mode": false
},
"auth": {
"secret": "prover secret key",
"challenge_expire_duration_sec": 3600,
"login_expire_duration_sec": 3600
}
},
"sequencer": {
"decryption_key": "sequencer decryption key"
}
}`

t.Run("Success Case", func(t *testing.T) {
Expand Down
4 changes: 3 additions & 1 deletion coordinator/internal/controller/api/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ var (

// InitController inits Controller with database
func InitController(cfg *config.Config, chainCfg *params.ChainConfig, db *gorm.DB, reg prometheus.Registerer) {
vf, err := verifier.NewVerifier(cfg.ProverManager.Verifier)
validiumMode := cfg.L2.ValidiumMode

vf, err := verifier.NewVerifier(cfg.ProverManager.Verifier, validiumMode)
if err != nil {
panic("proof receiver new verifier failure")
}
Expand Down
4 changes: 2 additions & 2 deletions coordinator/internal/logic/libzkp/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ func fromMessageTaskType(taskType int) int {
}

// Generate a universal task
func GenerateUniversalTask(taskType int, taskJSON, forkName string, expectedVk []byte) (bool, string, string, []byte) {
return generateUniversalTask(fromMessageTaskType(taskType), taskJSON, strings.ToLower(forkName), expectedVk)
func GenerateUniversalTask(taskType int, taskJSON, forkName string, expectedVk []byte, decryptionKey []byte) (bool, string, string, []byte) {
return generateUniversalTask(fromMessageTaskType(taskType), taskJSON, strings.ToLower(forkName), expectedVk, decryptionKey)
}

// Generate wrapped proof
Expand Down
4 changes: 3 additions & 1 deletion coordinator/internal/logic/libzkp/libzkp.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ HandlingResult gen_universal_task(
char* task,
char* fork_name,
const unsigned char* expected_vk,
size_t expected_vk_len
size_t expected_vk_len,
const unsigned char* decryption_key,
size_t decryption_key_len
);

// Release memory allocated for a HandlingResult returned by gen_universal_task
Expand Down
2 changes: 1 addition & 1 deletion coordinator/internal/logic/libzkp/mock_universal_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
func InitL2geth(configJSON string) {
}

func generateUniversalTask(taskType int, taskJSON, forkName string, expectedVk []byte) (bool, string, string, []byte) {
func generateUniversalTask(taskType int, taskJSON, forkName string, expectedVk []byte, decryptionKey []byte) (bool, string, string, []byte) {

fmt.Printf("call mocked generate universal task %d, taskJson %s\n", taskType, taskJSON)
var metadata interface{}
Expand Down
10 changes: 8 additions & 2 deletions coordinator/internal/logic/libzkp/universal_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func InitL2geth(configJSON string) {
C.init_l2geth(cConfig)
}

func generateUniversalTask(taskType int, taskJSON, forkName string, expectedVk []byte) (bool, string, string, []byte) {
func generateUniversalTask(taskType int, taskJSON, forkName string, expectedVk []byte, decryptionKey []byte) (bool, string, string, []byte) {
cTask := goToCString(taskJSON)
cForkName := goToCString(forkName)
defer freeCString(cTask)
Expand All @@ -29,7 +29,13 @@ func generateUniversalTask(taskType int, taskJSON, forkName string, expectedVk [
cVk = (*C.uchar)(unsafe.Pointer(&expectedVk[0]))
}

result := C.gen_universal_task(C.int(taskType), cTask, cForkName, cVk, C.size_t(len(expectedVk)))
// Create a C array from Go slice
var cDk *C.uchar
if len(decryptionKey) > 0 {
cDk = (*C.uchar)(unsafe.Pointer(&decryptionKey[0]))
}

result := C.gen_universal_task(C.int(taskType), cTask, cForkName, cVk, C.size_t(len(expectedVk)), cDk, C.size_t(len(decryptionKey)))
defer C.release_task_result(result)

// Check if the operation was successful
Expand Down
Loading