@@ -2,7 +2,6 @@ package system_contract
2
2
3
3
import (
4
4
"context"
5
- "math/big"
6
5
"sync"
7
6
"time"
8
7
@@ -13,7 +12,7 @@ import (
13
12
)
14
13
15
14
const (
16
- defaultSyncInterval = 10
15
+ defaultSyncInterval = 10 * time . Second
17
16
)
18
17
19
18
// SystemContract
@@ -34,9 +33,8 @@ type SystemContract struct {
34
33
// New creates a SystemContract consensus engine with the initial
35
34
// signers set to the ones provided by the user.
36
35
func New (ctx context.Context , config * params.SystemContractConfig , client sync_service.EthClient ) * SystemContract {
37
- blockNumber := big .NewInt (- 1 ) // todo: get block number from L1BlocksContract (l1 block hash relay) or other source (depending on exact design)
38
36
ctx , cancel := context .WithCancel (ctx )
39
- address , err := client .StorageAt (ctx , config .SystemContractAddress , config .SystemContractSlot , blockNumber )
37
+ address , err := client .StorageAt (ctx , config .SystemContractAddress , config .SystemContractSlot , nil )
40
38
if err != nil {
41
39
log .Error ("failed to get signer address from L1 System Contract" , "err" , err )
42
40
}
@@ -77,8 +75,7 @@ func (s *SystemContract) Start() {
77
75
case <- s .ctx .Done ():
78
76
return
79
77
case <- syncTicker .C :
80
- blockNumber := big .NewInt (- 1 ) // todo: get block number from L1BlocksContract (l1 block hash relay) or other source (depending on exact design)
81
- address , err := s .client .StorageAt (s .ctx , s .config .SystemContractAddress , s .config .SystemContractSlot , blockNumber )
78
+ address , err := s .client .StorageAt (s .ctx , s .config .SystemContractAddress , s .config .SystemContractSlot , nil )
82
79
if err != nil {
83
80
log .Error ("failed to get signer address from L1 System Contract" , "err" , err )
84
81
}
@@ -94,4 +91,4 @@ func (s *SystemContract) Start() {
94
91
func (s * SystemContract ) Close () error {
95
92
s .cancel ()
96
93
return nil
97
- }
94
+ }
0 commit comments