mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-01-11 23:18:07 -05:00
Compare commits
1 Commits
fix/verifi
...
pull-model
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
106f409a02 |
@@ -5,7 +5,7 @@ import (
|
||||
"runtime/debug"
|
||||
)
|
||||
|
||||
var tag = "v4.1.0"
|
||||
var tag = "v4.1.1"
|
||||
|
||||
var commit = func() string {
|
||||
if info, ok := debug.ReadBuildInfo(); ok {
|
||||
|
||||
@@ -8,24 +8,19 @@ import (
|
||||
"scroll-tech/common/database"
|
||||
)
|
||||
|
||||
const (
|
||||
defaultNumberOfVerifierWorkers = 10
|
||||
defaultNumberOfSessionRetryAttempts = 2
|
||||
)
|
||||
|
||||
// ProverManager loads sequencer configuration items.
|
||||
type ProverManager struct {
|
||||
// The amount of provers to pick per proof generation session.
|
||||
ProversPerSession uint8 `json:"provers_per_session"`
|
||||
// Number of attempts that a session can be retried if previous attempts failed.
|
||||
// Currently we only consider proving timeout as failure here.
|
||||
SessionAttempts uint8 `json:"session_attempts,omitempty"`
|
||||
SessionAttempts uint8 `json:"session_attempts"`
|
||||
// Zk verifier config.
|
||||
Verifier *VerifierConfig `json:"verifier,omitempty"`
|
||||
// Proof collection time (in seconds).
|
||||
CollectionTimeSec int `json:"collection_time_sec"`
|
||||
// Max number of workers in verifier worker pool
|
||||
MaxVerifierWorkers int `json:"max_verifier_workers,omitempty"`
|
||||
MaxVerifierWorkers int `json:"max_verifier_workers"`
|
||||
}
|
||||
|
||||
// L2 loads l2geth configuration items.
|
||||
@@ -38,7 +33,7 @@ type L2 struct {
|
||||
type Auth struct {
|
||||
Secret string `json:"secret"`
|
||||
ChallengeExpireDurationSec int `json:"challenge_expire_duration_sec"`
|
||||
LoginExpireDurationSec int `json:"token_expire_duration_sec"` // unit: seconds
|
||||
LoginExpireDurationSec int `json:"token_expire_duration_sec"`
|
||||
}
|
||||
|
||||
// Config load configuration items.
|
||||
@@ -69,12 +64,5 @@ func NewConfig(file string) (*Config, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if cfg.ProverManager.MaxVerifierWorkers == 0 {
|
||||
cfg.ProverManager.MaxVerifierWorkers = defaultNumberOfVerifierWorkers
|
||||
}
|
||||
if cfg.ProverManager.SessionAttempts == 0 {
|
||||
cfg.ProverManager.SessionAttempts = defaultNumberOfSessionRetryAttempts
|
||||
}
|
||||
|
||||
return cfg, nil
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
//go:build ffi
|
||||
|
||||
// go test -v -race -gcflags="-l" -ldflags="-s=false" -tags ffi ./...
|
||||
package core_test
|
||||
|
||||
import (
|
||||
@@ -13,7 +12,6 @@ import (
|
||||
"github.com/scroll-tech/go-ethereum/core/types"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
scrollTypes "scroll-tech/common/types"
|
||||
"scroll-tech/common/types/message"
|
||||
|
||||
"scroll-tech/prover/config"
|
||||
@@ -49,32 +47,6 @@ func TestFFI(t *testing.T) {
|
||||
as.NoError(err)
|
||||
t.Log("Converted to chunk infos")
|
||||
|
||||
wrappedBlock1 := &scrollTypes.WrappedBlock{
|
||||
Header: chunkTrace1[0].Header,
|
||||
Transactions: chunkTrace1[0].Transactions,
|
||||
WithdrawRoot: chunkTrace1[0].WithdrawTrieRoot,
|
||||
}
|
||||
chunk1 := &scrollTypes.Chunk{Blocks: []*scrollTypes.WrappedBlock{wrappedBlock1}}
|
||||
chunkHash1, err := chunk1.Hash(0)
|
||||
as.NoError(err)
|
||||
as.Equal(chunkInfo1.PostStateRoot, wrappedBlock1.Header.Root)
|
||||
as.Equal(chunkInfo1.WithdrawRoot, wrappedBlock1.WithdrawRoot)
|
||||
as.Equal(chunkInfo1.DataHash, chunkHash1)
|
||||
t.Log("Successful to check chunk info 1")
|
||||
|
||||
wrappedBlock2 := &scrollTypes.WrappedBlock{
|
||||
Header: chunkTrace2[0].Header,
|
||||
Transactions: chunkTrace2[0].Transactions,
|
||||
WithdrawRoot: chunkTrace2[0].WithdrawTrieRoot,
|
||||
}
|
||||
chunk2 := &scrollTypes.Chunk{Blocks: []*scrollTypes.WrappedBlock{wrappedBlock2}}
|
||||
chunkHash2, err := chunk2.Hash(chunk1.NumL1Messages(0))
|
||||
as.NoError(err)
|
||||
as.Equal(chunkInfo2.PostStateRoot, wrappedBlock2.Header.Root)
|
||||
as.Equal(chunkInfo2.WithdrawRoot, wrappedBlock2.WithdrawRoot)
|
||||
as.Equal(chunkInfo2.DataHash, chunkHash2)
|
||||
t.Log("Successful to check chunk info 2")
|
||||
|
||||
chunkProof1, err := chunkProverCore.ProveChunk("chunk_proof1", chunkTrace1)
|
||||
as.NoError(err)
|
||||
t.Log("Generated and dumped chunk proof 1")
|
||||
|
||||
Reference in New Issue
Block a user