mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-04-23 03:00:50 -04:00
feat: update
This commit is contained in:
@@ -584,47 +584,47 @@ func testValidProof(t *testing.T) {
|
||||
provers[i].submitProof(t, proverTask, proofStatus, types.Success, "istanbul")
|
||||
}
|
||||
|
||||
//// verify proof status
|
||||
//var (
|
||||
// tick = time.Tick(1500 * time.Millisecond)
|
||||
// tickStop = time.Tick(time.Minute)
|
||||
//)
|
||||
//
|
||||
//var (
|
||||
// chunkProofStatus types.ProvingStatus
|
||||
// batchProofStatus types.ProvingStatus
|
||||
// chunkActiveAttempts int16
|
||||
// chunkMaxAttempts int16
|
||||
// batchActiveAttempts int16
|
||||
// batchMaxAttempts int16
|
||||
//)
|
||||
//
|
||||
//for {
|
||||
// select {
|
||||
// case <-tick:
|
||||
// chunkProofStatus, err = chunkOrm.GetProvingStatusByHash(context.Background(), dbChunk.Hash)
|
||||
// assert.NoError(t, err)
|
||||
// batchProofStatus, err = batchOrm.GetProvingStatusByHash(context.Background(), batch.Hash)
|
||||
// assert.NoError(t, err)
|
||||
// if chunkProofStatus == types.ProvingTaskVerified && batchProofStatus == types.ProvingTaskVerified {
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// chunkActiveAttempts, chunkMaxAttempts, err = chunkOrm.GetAttemptsByHash(context.Background(), dbChunk.Hash)
|
||||
// assert.NoError(t, err)
|
||||
// assert.Equal(t, 1, int(chunkMaxAttempts))
|
||||
// assert.Equal(t, 0, int(chunkActiveAttempts))
|
||||
//
|
||||
// batchActiveAttempts, batchMaxAttempts, err = batchOrm.GetAttemptsByHash(context.Background(), batch.Hash)
|
||||
// assert.NoError(t, err)
|
||||
// assert.Equal(t, 1, int(batchMaxAttempts))
|
||||
// assert.Equal(t, 0, int(batchActiveAttempts))
|
||||
//
|
||||
// case <-tickStop:
|
||||
// t.Error("failed to check proof status", "chunkProofStatus", chunkProofStatus.String(), "batchProofStatus", batchProofStatus.String())
|
||||
// return
|
||||
// }
|
||||
//}
|
||||
// verify proof status
|
||||
var (
|
||||
tick = time.Tick(1500 * time.Millisecond)
|
||||
tickStop = time.Tick(time.Minute)
|
||||
)
|
||||
|
||||
var (
|
||||
chunkProofStatus types.ProvingStatus
|
||||
batchProofStatus types.ProvingStatus
|
||||
chunkActiveAttempts int16
|
||||
chunkMaxAttempts int16
|
||||
batchActiveAttempts int16
|
||||
batchMaxAttempts int16
|
||||
)
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-tick:
|
||||
chunkProofStatus, err = chunkOrm.GetProvingStatusByHash(context.Background(), dbChunk.Hash)
|
||||
assert.NoError(t, err)
|
||||
batchProofStatus, err = batchOrm.GetProvingStatusByHash(context.Background(), batch.Hash)
|
||||
assert.NoError(t, err)
|
||||
if chunkProofStatus == types.ProvingTaskVerified && batchProofStatus == types.ProvingTaskVerified {
|
||||
return
|
||||
}
|
||||
|
||||
chunkActiveAttempts, chunkMaxAttempts, err = chunkOrm.GetAttemptsByHash(context.Background(), dbChunk.Hash)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, 1, int(chunkMaxAttempts))
|
||||
assert.Equal(t, 0, int(chunkActiveAttempts))
|
||||
|
||||
batchActiveAttempts, batchMaxAttempts, err = batchOrm.GetAttemptsByHash(context.Background(), batch.Hash)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, 1, int(batchMaxAttempts))
|
||||
assert.Equal(t, 0, int(batchActiveAttempts))
|
||||
|
||||
case <-tickStop:
|
||||
t.Error("failed to check proof status", "chunkProofStatus", chunkProofStatus.String(), "batchProofStatus", batchProofStatus.String())
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func testInvalidProof(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user