@@ -2,7 +2,6 @@ package system_contract
22
33import (
44 "context"
5- "math/big"
65 "sync"
76 "time"
87
@@ -13,7 +12,7 @@ import (
1312)
1413
1514const (
16- defaultSyncInterval = 10
15+ defaultSyncInterval = 10 * time . Second
1716)
1817
1918// SystemContract
@@ -34,9 +33,8 @@ type SystemContract struct {
3433// New creates a SystemContract consensus engine with the initial
3534// signers set to the ones provided by the user.
3635func 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)
3836 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 )
4038 if err != nil {
4139 log .Error ("failed to get signer address from L1 System Contract" , "err" , err )
4240 }
@@ -77,8 +75,7 @@ func (s *SystemContract) Start() {
7775 case <- s .ctx .Done ():
7876 return
7977 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 )
8279 if err != nil {
8380 log .Error ("failed to get signer address from L1 System Contract" , "err" , err )
8481 }
@@ -94,4 +91,4 @@ func (s *SystemContract) Start() {
9491func (s * SystemContract ) Close () error {
9592 s .cancel ()
9693 return nil
97- }
94+ }
0 commit comments