Skip to content

Commit 2924fdf

Browse files
committed
ethereum, ethclient: add SyncProgress API endpoint
1 parent eac390f commit 2924fdf

File tree

7 files changed

+105
-55
lines changed

7 files changed

+105
-55
lines changed

eth/downloader/api.go

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package downloader
1919
import (
2020
"sync"
2121

22+
ethereum "github.com/ethereum/go-ethereum"
2223
"github.com/ethereum/go-ethereum/event"
2324
"github.com/ethereum/go-ethereum/rpc"
2425
"golang.org/x/net/context"
@@ -73,9 +74,10 @@ func (api *PublicDownloaderAPI) eventLoop() {
7374
var notification interface{}
7475
switch event.Data.(type) {
7576
case StartEvent:
76-
result := &SyncingResult{Syncing: true}
77-
result.Status.Origin, result.Status.Current, result.Status.Height, result.Status.Pulled, result.Status.Known = api.d.Progress()
78-
notification = result
77+
notification = &SyncingResult{
78+
Syncing: true,
79+
Status: api.d.Progress(),
80+
}
7981
case DoneEvent, FailedEvent:
8082
notification = false
8183
}
@@ -117,19 +119,10 @@ func (api *PublicDownloaderAPI) Syncing(ctx context.Context) (*rpc.Subscription,
117119
return rpcSub, nil
118120
}
119121

120-
// Progress gives progress indications when the node is synchronising with the Ethereum network.
121-
type Progress struct {
122-
Origin uint64 `json:"startingBlock"`
123-
Current uint64 `json:"currentBlock"`
124-
Height uint64 `json:"highestBlock"`
125-
Pulled uint64 `json:"pulledStates"`
126-
Known uint64 `json:"knownStates"`
127-
}
128-
129122
// SyncingResult provides information about the current synchronisation status for this node.
130123
type SyncingResult struct {
131-
Syncing bool `json:"syncing"`
132-
Status Progress `json:"status"`
124+
Syncing bool `json:"syncing"`
125+
Status ethereum.SyncProgress `json:"status"`
133126
}
134127

135128
// uninstallSyncSubscriptionRequest uninstalles a syncing subscription in the API event loop.

eth/downloader/downloader.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"sync/atomic"
2929
"time"
3030

31+
ethereum "github.com/ethereum/go-ethereum"
3132
"github.com/ethereum/go-ethereum/common"
3233
"github.com/ethereum/go-ethereum/core/types"
3334
"github.com/ethereum/go-ethereum/ethdb"
@@ -211,7 +212,7 @@ func New(stateDb ethdb.Database, mux *event.TypeMux, hasHeader headerCheckFn, ha
211212
// In addition, during the state download phase of fast synchronisation the number
212213
// of processed and the total number of known states are also returned. Otherwise
213214
// these are zero.
214-
func (d *Downloader) Progress() (uint64, uint64, uint64, uint64, uint64) {
215+
func (d *Downloader) Progress() ethereum.SyncProgress {
215216
// Fetch the pending state count outside of the lock to prevent unforeseen deadlocks
216217
pendingStates := uint64(d.queue.PendingNodeData())
217218

@@ -228,7 +229,13 @@ func (d *Downloader) Progress() (uint64, uint64, uint64, uint64, uint64) {
228229
case LightSync:
229230
current = d.headHeader().Number.Uint64()
230231
}
231-
return d.syncStatsChainOrigin, current, d.syncStatsChainHeight, d.syncStatsStateDone, d.syncStatsStateDone + pendingStates
232+
return ethereum.SyncProgress{
233+
StartingBlock: d.syncStatsChainOrigin,
234+
CurrentBlock: current,
235+
HighestBlock: d.syncStatsChainHeight,
236+
PulledStates: d.syncStatsStateDone,
237+
KnownStates: d.syncStatsStateDone + pendingStates,
238+
}
232239
}
233240

234241
// Synchronising returns whether the downloader is currently retrieving blocks.

eth/downloader/downloader_test.go

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,8 +1377,8 @@ func testSyncProgress(t *testing.T, protocol int, mode SyncMode) {
13771377
<-progress
13781378
}
13791379
// Retrieve the sync progress and ensure they are zero (pristine sync)
1380-
if origin, current, latest, _, _ := tester.downloader.Progress(); origin != 0 || current != 0 || latest != 0 {
1381-
t.Fatalf("Pristine progress mismatch: have %v/%v/%v, want %v/%v/%v", origin, current, latest, 0, 0, 0)
1380+
if progress := tester.downloader.Progress(); progress.StartingBlock != 0 || progress.CurrentBlock != 0 || progress.HighestBlock != 0 {
1381+
t.Fatalf("Pristine progress mismatch: have %v/%v/%v, want %v/%v/%v", progress.StartingBlock, progress.CurrentBlock, progress.HighestBlock, 0, 0, 0)
13821382
}
13831383
// Synchronise half the blocks and check initial progress
13841384
tester.newPeer("peer-half", protocol, hashes[targetBlocks/2:], headers, blocks, receipts)
@@ -1392,8 +1392,8 @@ func testSyncProgress(t *testing.T, protocol int, mode SyncMode) {
13921392
}
13931393
}()
13941394
<-starting
1395-
if origin, current, latest, _, _ := tester.downloader.Progress(); origin != 0 || current != 0 || latest != uint64(targetBlocks/2+1) {
1396-
t.Fatalf("Initial progress mismatch: have %v/%v/%v, want %v/%v/%v", origin, current, latest, 0, 0, targetBlocks/2+1)
1395+
if progress := tester.downloader.Progress(); progress.StartingBlock != 0 || progress.CurrentBlock != 0 || progress.HighestBlock != uint64(targetBlocks/2+1) {
1396+
t.Fatalf("Initial progress mismatch: have %v/%v/%v, want %v/%v/%v", progress.StartingBlock, progress.CurrentBlock, progress.HighestBlock, 0, 0, targetBlocks/2+1)
13971397
}
13981398
progress <- struct{}{}
13991399
pending.Wait()
@@ -1409,15 +1409,15 @@ func testSyncProgress(t *testing.T, protocol int, mode SyncMode) {
14091409
}
14101410
}()
14111411
<-starting
1412-
if origin, current, latest, _, _ := tester.downloader.Progress(); origin != uint64(targetBlocks/2+1) || current != uint64(targetBlocks/2+1) || latest != uint64(targetBlocks) {
1413-
t.Fatalf("Completing progress mismatch: have %v/%v/%v, want %v/%v/%v", origin, current, latest, targetBlocks/2+1, targetBlocks/2+1, targetBlocks)
1412+
if progress := tester.downloader.Progress(); progress.StartingBlock != uint64(targetBlocks/2+1) || progress.CurrentBlock != uint64(targetBlocks/2+1) || progress.HighestBlock != uint64(targetBlocks) {
1413+
t.Fatalf("Completing progress mismatch: have %v/%v/%v, want %v/%v/%v", progress.StartingBlock, progress.CurrentBlock, progress.HighestBlock, targetBlocks/2+1, targetBlocks/2+1, targetBlocks)
14141414
}
14151415
progress <- struct{}{}
14161416
pending.Wait()
14171417

14181418
// Check final progress after successful sync
1419-
if origin, current, latest, _, _ := tester.downloader.Progress(); origin != uint64(targetBlocks/2+1) || current != uint64(targetBlocks) || latest != uint64(targetBlocks) {
1420-
t.Fatalf("Final progress mismatch: have %v/%v/%v, want %v/%v/%v", origin, current, latest, targetBlocks/2+1, targetBlocks, targetBlocks)
1419+
if progress := tester.downloader.Progress(); progress.StartingBlock != uint64(targetBlocks/2+1) || progress.CurrentBlock != uint64(targetBlocks) || progress.HighestBlock != uint64(targetBlocks) {
1420+
t.Fatalf("Final progress mismatch: have %v/%v/%v, want %v/%v/%v", progress.StartingBlock, progress.CurrentBlock, progress.HighestBlock, targetBlocks/2+1, targetBlocks, targetBlocks)
14211421
}
14221422
}
14231423

@@ -1450,8 +1450,8 @@ func testForkedSyncProgress(t *testing.T, protocol int, mode SyncMode) {
14501450
<-progress
14511451
}
14521452
// Retrieve the sync progress and ensure they are zero (pristine sync)
1453-
if origin, current, latest, _, _ := tester.downloader.Progress(); origin != 0 || current != 0 || latest != 0 {
1454-
t.Fatalf("Pristine progress mismatch: have %v/%v/%v, want %v/%v/%v", origin, current, latest, 0, 0, 0)
1453+
if progress := tester.downloader.Progress(); progress.StartingBlock != 0 || progress.CurrentBlock != 0 || progress.HighestBlock != 0 {
1454+
t.Fatalf("Pristine progress mismatch: have %v/%v/%v, want %v/%v/%v", progress.StartingBlock, progress.CurrentBlock, progress.HighestBlock, 0, 0, 0)
14551455
}
14561456
// Synchronise with one of the forks and check progress
14571457
tester.newPeer("fork A", protocol, hashesA, headersA, blocksA, receiptsA)
@@ -1465,8 +1465,8 @@ func testForkedSyncProgress(t *testing.T, protocol int, mode SyncMode) {
14651465
}
14661466
}()
14671467
<-starting
1468-
if origin, current, latest, _, _ := tester.downloader.Progress(); origin != 0 || current != 0 || latest != uint64(len(hashesA)-1) {
1469-
t.Fatalf("Initial progress mismatch: have %v/%v/%v, want %v/%v/%v", origin, current, latest, 0, 0, len(hashesA)-1)
1468+
if progress := tester.downloader.Progress(); progress.StartingBlock != 0 || progress.CurrentBlock != 0 || progress.HighestBlock != uint64(len(hashesA)-1) {
1469+
t.Fatalf("Initial progress mismatch: have %v/%v/%v, want %v/%v/%v", progress.StartingBlock, progress.CurrentBlock, progress.HighestBlock, 0, 0, len(hashesA)-1)
14701470
}
14711471
progress <- struct{}{}
14721472
pending.Wait()
@@ -1485,15 +1485,15 @@ func testForkedSyncProgress(t *testing.T, protocol int, mode SyncMode) {
14851485
}
14861486
}()
14871487
<-starting
1488-
if origin, current, latest, _, _ := tester.downloader.Progress(); origin != uint64(common) || current != uint64(len(hashesA)-1) || latest != uint64(len(hashesB)-1) {
1489-
t.Fatalf("Forking progress mismatch: have %v/%v/%v, want %v/%v/%v", origin, current, latest, common, len(hashesA)-1, len(hashesB)-1)
1488+
if progress := tester.downloader.Progress(); progress.StartingBlock != uint64(common) || progress.CurrentBlock != uint64(len(hashesA)-1) || progress.HighestBlock != uint64(len(hashesB)-1) {
1489+
t.Fatalf("Forking progress mismatch: have %v/%v/%v, want %v/%v/%v", progress.StartingBlock, progress.CurrentBlock, progress.HighestBlock, common, len(hashesA)-1, len(hashesB)-1)
14901490
}
14911491
progress <- struct{}{}
14921492
pending.Wait()
14931493

14941494
// Check final progress after successful sync
1495-
if origin, current, latest, _, _ := tester.downloader.Progress(); origin != uint64(common) || current != uint64(len(hashesB)-1) || latest != uint64(len(hashesB)-1) {
1496-
t.Fatalf("Final progress mismatch: have %v/%v/%v, want %v/%v/%v", origin, current, latest, common, len(hashesB)-1, len(hashesB)-1)
1495+
if progress := tester.downloader.Progress(); progress.StartingBlock != uint64(common) || progress.CurrentBlock != uint64(len(hashesB)-1) || progress.HighestBlock != uint64(len(hashesB)-1) {
1496+
t.Fatalf("Final progress mismatch: have %v/%v/%v, want %v/%v/%v", progress.StartingBlock, progress.CurrentBlock, progress.HighestBlock, common, len(hashesB)-1, len(hashesB)-1)
14971497
}
14981498
}
14991499

@@ -1526,8 +1526,8 @@ func testFailedSyncProgress(t *testing.T, protocol int, mode SyncMode) {
15261526
<-progress
15271527
}
15281528
// Retrieve the sync progress and ensure they are zero (pristine sync)
1529-
if origin, current, latest, _, _ := tester.downloader.Progress(); origin != 0 || current != 0 || latest != 0 {
1530-
t.Fatalf("Pristine progress mismatch: have %v/%v/%v, want %v/%v/%v", origin, current, latest, 0, 0, 0)
1529+
if progress := tester.downloader.Progress(); progress.StartingBlock != 0 || progress.CurrentBlock != 0 || progress.HighestBlock != 0 {
1530+
t.Fatalf("Pristine progress mismatch: have %v/%v/%v, want %v/%v/%v", progress.StartingBlock, progress.CurrentBlock, progress.HighestBlock, 0, 0, 0)
15311531
}
15321532
// Attempt a full sync with a faulty peer
15331533
tester.newPeer("faulty", protocol, hashes, headers, blocks, receipts)
@@ -1546,8 +1546,8 @@ func testFailedSyncProgress(t *testing.T, protocol int, mode SyncMode) {
15461546
}
15471547
}()
15481548
<-starting
1549-
if origin, current, latest, _, _ := tester.downloader.Progress(); origin != 0 || current != 0 || latest != uint64(targetBlocks) {
1550-
t.Fatalf("Initial progress mismatch: have %v/%v/%v, want %v/%v/%v", origin, current, latest, 0, 0, targetBlocks)
1549+
if progress := tester.downloader.Progress(); progress.StartingBlock != 0 || progress.CurrentBlock != 0 || progress.HighestBlock != uint64(targetBlocks) {
1550+
t.Fatalf("Initial progress mismatch: have %v/%v/%v, want %v/%v/%v", progress.StartingBlock, progress.CurrentBlock, progress.HighestBlock, 0, 0, targetBlocks)
15511551
}
15521552
progress <- struct{}{}
15531553
pending.Wait()
@@ -1563,15 +1563,15 @@ func testFailedSyncProgress(t *testing.T, protocol int, mode SyncMode) {
15631563
}
15641564
}()
15651565
<-starting
1566-
if origin, current, latest, _, _ := tester.downloader.Progress(); origin != 0 || current > uint64(targetBlocks/2) || latest != uint64(targetBlocks) {
1567-
t.Fatalf("Completing progress mismatch: have %v/%v/%v, want %v/0-%v/%v", origin, current, latest, 0, targetBlocks/2, targetBlocks)
1566+
if progress := tester.downloader.Progress(); progress.StartingBlock != 0 || progress.CurrentBlock > uint64(targetBlocks/2) || progress.HighestBlock != uint64(targetBlocks) {
1567+
t.Fatalf("Completing progress mismatch: have %v/%v/%v, want %v/0-%v/%v", progress.StartingBlock, progress.CurrentBlock, progress.HighestBlock, 0, targetBlocks/2, targetBlocks)
15681568
}
15691569
progress <- struct{}{}
15701570
pending.Wait()
15711571

15721572
// Check final progress after successful sync
1573-
if origin, current, latest, _, _ := tester.downloader.Progress(); origin > uint64(targetBlocks/2) || current != uint64(targetBlocks) || latest != uint64(targetBlocks) {
1574-
t.Fatalf("Final progress mismatch: have %v/%v/%v, want 0-%v/%v/%v", origin, current, latest, targetBlocks/2, targetBlocks, targetBlocks)
1573+
if progress := tester.downloader.Progress(); progress.StartingBlock > uint64(targetBlocks/2) || progress.CurrentBlock != uint64(targetBlocks) || progress.HighestBlock != uint64(targetBlocks) {
1574+
t.Fatalf("Final progress mismatch: have %v/%v/%v, want 0-%v/%v/%v", progress.StartingBlock, progress.CurrentBlock, progress.HighestBlock, targetBlocks/2, targetBlocks, targetBlocks)
15751575
}
15761576
}
15771577

@@ -1603,8 +1603,8 @@ func testFakedSyncProgress(t *testing.T, protocol int, mode SyncMode) {
16031603
<-progress
16041604
}
16051605
// Retrieve the sync progress and ensure they are zero (pristine sync)
1606-
if origin, current, latest, _, _ := tester.downloader.Progress(); origin != 0 || current != 0 || latest != 0 {
1607-
t.Fatalf("Pristine progress mismatch: have %v/%v/%v, want %v/%v/%v", origin, current, latest, 0, 0, 0)
1606+
if progress := tester.downloader.Progress(); progress.StartingBlock != 0 || progress.CurrentBlock != 0 || progress.HighestBlock != 0 {
1607+
t.Fatalf("Pristine progress mismatch: have %v/%v/%v, want %v/%v/%v", progress.StartingBlock, progress.CurrentBlock, progress.HighestBlock, 0, 0, 0)
16081608
}
16091609
// Create and sync with an attacker that promises a higher chain than available
16101610
tester.newPeer("attack", protocol, hashes, headers, blocks, receipts)
@@ -1624,8 +1624,8 @@ func testFakedSyncProgress(t *testing.T, protocol int, mode SyncMode) {
16241624
}
16251625
}()
16261626
<-starting
1627-
if origin, current, latest, _, _ := tester.downloader.Progress(); origin != 0 || current != 0 || latest != uint64(targetBlocks+3) {
1628-
t.Fatalf("Initial progress mismatch: have %v/%v/%v, want %v/%v/%v", origin, current, latest, 0, 0, targetBlocks+3)
1627+
if progress := tester.downloader.Progress(); progress.StartingBlock != 0 || progress.CurrentBlock != 0 || progress.HighestBlock != uint64(targetBlocks+3) {
1628+
t.Fatalf("Initial progress mismatch: have %v/%v/%v, want %v/%v/%v", progress.StartingBlock, progress.CurrentBlock, progress.HighestBlock, 0, 0, targetBlocks+3)
16291629
}
16301630
progress <- struct{}{}
16311631
pending.Wait()
@@ -1641,15 +1641,15 @@ func testFakedSyncProgress(t *testing.T, protocol int, mode SyncMode) {
16411641
}
16421642
}()
16431643
<-starting
1644-
if origin, current, latest, _, _ := tester.downloader.Progress(); origin != 0 || current > uint64(targetBlocks) || latest != uint64(targetBlocks) {
1645-
t.Fatalf("Completing progress mismatch: have %v/%v/%v, want %v/0-%v/%v", origin, current, latest, 0, targetBlocks, targetBlocks)
1644+
if progress := tester.downloader.Progress(); progress.StartingBlock != 0 || progress.CurrentBlock > uint64(targetBlocks) || progress.HighestBlock != uint64(targetBlocks) {
1645+
t.Fatalf("Completing progress mismatch: have %v/%v/%v, want %v/0-%v/%v", progress.StartingBlock, progress.CurrentBlock, progress.HighestBlock, 0, targetBlocks, targetBlocks)
16461646
}
16471647
progress <- struct{}{}
16481648
pending.Wait()
16491649

16501650
// Check final progress after successful sync
1651-
if origin, current, latest, _, _ := tester.downloader.Progress(); origin > uint64(targetBlocks) || current != uint64(targetBlocks) || latest != uint64(targetBlocks) {
1652-
t.Fatalf("Final progress mismatch: have %v/%v/%v, want 0-%v/%v/%v", origin, current, latest, targetBlocks, targetBlocks, targetBlocks)
1651+
if progress := tester.downloader.Progress(); progress.StartingBlock > uint64(targetBlocks) || progress.CurrentBlock != uint64(targetBlocks) || progress.HighestBlock != uint64(targetBlocks) {
1652+
t.Fatalf("Final progress mismatch: have %v/%v/%v, want 0-%v/%v/%v", progress.StartingBlock, progress.CurrentBlock, progress.HighestBlock, targetBlocks, targetBlocks, targetBlocks)
16531653
}
16541654
}
16551655

ethclient/ethclient.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,39 @@ func toBlockNumArg(number *big.Int) string {
191191
return fmt.Sprintf("%#x", number)
192192
}
193193

194+
type rpcProgress struct {
195+
StartingBlock rpc.HexNumber
196+
CurrentBlock rpc.HexNumber
197+
HighestBlock rpc.HexNumber
198+
PulledStates rpc.HexNumber
199+
KnownStates rpc.HexNumber
200+
}
201+
202+
// SyncProgress retrieves the current progress of the sync algorithm. If there's
203+
// no sync currently running, it returns nil.
204+
func (ec *Client) SyncProgress(ctx context.Context) (*ethereum.SyncProgress, error) {
205+
var raw json.RawMessage
206+
if err := ec.c.CallContext(ctx, &raw, "eth_syncing"); err != nil {
207+
return nil, err
208+
}
209+
// Handle the possible response types
210+
var syncing bool
211+
if err := json.Unmarshal(raw, &syncing); err == nil {
212+
return nil, nil // Not syncing (always false)
213+
}
214+
var progress *rpcProgress
215+
if err := json.Unmarshal(raw, &progress); err != nil {
216+
return nil, err
217+
}
218+
return &ethereum.SyncProgress{
219+
StartingBlock: progress.StartingBlock.Uint64(),
220+
CurrentBlock: progress.CurrentBlock.Uint64(),
221+
HighestBlock: progress.HighestBlock.Uint64(),
222+
PulledStates: progress.PulledStates.Uint64(),
223+
KnownStates: progress.KnownStates.Uint64(),
224+
}, nil
225+
}
226+
194227
// SubscribeNewHead subscribes to notifications about the current blockchain head
195228
// on the given channel.
196229
func (ec *Client) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error) {

ethclient/ethclient_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import "github.com/ethereum/go-ethereum"
66
var (
77
_ = ethereum.ChainReader(&Client{})
88
_ = ethereum.ChainStateReader(&Client{})
9+
_ = ethereum.ChainSyncReader(&Client{})
910
_ = ethereum.ChainHeadEventer(&Client{})
1011
_ = ethereum.ContractCaller(&Client{})
1112
_ = ethereum.GasEstimator(&Client{})

interfaces.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,22 @@ type ChainStateReader interface {
6767
NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)
6868
}
6969

70+
// SyncProgress gives progress indications when the node is synchronising with
71+
// the Ethereum network.
72+
type SyncProgress struct {
73+
StartingBlock uint64 // Block number where sync began
74+
CurrentBlock uint64 // Current block number where sync is at
75+
HighestBlock uint64 // Highest alleged block number in the chain
76+
PulledStates uint64 // Number of state trie entries already downloaded
77+
KnownStates uint64 // Total number os state trie entries known about
78+
}
79+
80+
// ChainSyncReader wraps access to the node's current sync status. If there's no
81+
// sync currently running, it returns nil.
82+
type ChainSyncReader interface {
83+
SyncProgress(ctx context.Context) (*SyncProgress, error)
84+
}
85+
7086
// A ChainHeadEventer returns notifications whenever the canonical head block is updated.
7187
type ChainHeadEventer interface {
7288
SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (Subscription, error)

internal/ethapi/api.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,19 @@ func (s *PublicEthereumAPI) ProtocolVersion() *rpc.HexNumber {
7373
// - pulledStates: number of state entries processed until now
7474
// - knownStates: number of known state entries that still need to be pulled
7575
func (s *PublicEthereumAPI) Syncing() (interface{}, error) {
76-
origin, current, height, pulled, known := s.b.Downloader().Progress()
76+
progress := s.b.Downloader().Progress()
7777

7878
// Return not syncing if the synchronisation already completed
79-
if current >= height {
79+
if progress.CurrentBlock >= progress.HighestBlock {
8080
return false, nil
8181
}
8282
// Otherwise gather the block sync stats
8383
return map[string]interface{}{
84-
"startingBlock": rpc.NewHexNumber(origin),
85-
"currentBlock": rpc.NewHexNumber(current),
86-
"highestBlock": rpc.NewHexNumber(height),
87-
"pulledStates": rpc.NewHexNumber(pulled),
88-
"knownStates": rpc.NewHexNumber(known),
84+
"startingBlock": rpc.NewHexNumber(progress.StartingBlock),
85+
"currentBlock": rpc.NewHexNumber(progress.CurrentBlock),
86+
"highestBlock": rpc.NewHexNumber(progress.HighestBlock),
87+
"pulledStates": rpc.NewHexNumber(progress.PulledStates),
88+
"knownStates": rpc.NewHexNumber(progress.KnownStates),
8989
}, nil
9090
}
9191

0 commit comments

Comments
 (0)