verbose logging + log statements

This commit is contained in:
Jared Wasinger 2024-03-26 17:58:27 -07:00
parent c7942ce10d
commit 16ef4825b5
2 changed files with 3 additions and 0 deletions

View file

@ -498,6 +498,7 @@ func (d *Downloader) syncWithPeer(p *peerConnection, hash common.Hash, td, ttd *
if number < oldest.Number.Uint64() {
count := int(oldest.Number.Uint64() - number) // it's capped by fsMinFullBlocks
headers := d.readHeaderRange(oldest, count)
fmt.Printf("readHeaderRange, oldest=%x, oldest num=%d, count=%d\n", oldest.Hash(), oldest.Number, count)
if len(headers) == count {
pivot = headers[len(headers)-1]
log.Warn("Retrieved pivot header from local", "number", pivot.Number, "hash", pivot.Hash(), "latest", latest.Number, "oldest", oldest.Number)

View file

@ -1355,6 +1355,7 @@ func testBeaconForkedSyncProgress(t *testing.T, protocol uint, mode SyncMode) {
}
}()
log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stdout, log.LevelInfo, false)))
<-starting
progress <- struct{}{}
select {
@ -1367,6 +1368,7 @@ func testBeaconForkedSyncProgress(t *testing.T, protocol uint, mode SyncMode) {
t.Fatalf("Failed to sync chain in three seconds")
}
fmt.Println("syncing to fork B")
// Set the head to a second fork
tester.newPeer("fork B", protocol, chainB.blocks[1:])
pending.Add(1)