e3: eth_traceTransaction, eth_replayTransaction, eth_call, ... (#716)

This commit is contained in:
Alex Sharov 2022-10-31 12:31:31 +07:00 committed by GitHub
parent 2f2cffd86b
commit fe5dd317e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 6 deletions

View File

@ -21,6 +21,7 @@ import (
"encoding/binary"
"fmt"
"os"
"path/filepath"
"strconv"
"github.com/ledgerwatch/erigon-lib/common/dbg"
@ -372,6 +373,10 @@ func (d *Decompressor) Close() error {
}
func (d *Decompressor) FilePath() string { return d.compressedFile }
func (d *Decompressor) FileName() string {
_, fName := filepath.Split(d.compressedFile)
return fName
}
// WithReadAhead - Expect read in sequential order. (Hence, pages in the given range can be aggressively read ahead, and may be freed soon after they are accessed.)
func (d *Decompressor) WithReadAhead(f func() error) error {

View File

@ -147,11 +147,13 @@ func OpenIndex(indexFile string) (*Index, error) {
return idx, nil
}
func (idx *Index) Size() int64 {
return idx.size
}
func (idx *Index) Size() int64 { return idx.size }
func (idx *Index) BaseDataID() uint64 { return idx.baseDataID }
func (idx *Index) FilePath() string { return idx.indexFile }
func (idx *Index) FileName() string {
_, fName := filepath.Split(idx.indexFile)
return fName
}
func (idx *Index) Close() error {
if idx == nil {

View File

@ -425,7 +425,6 @@ func (a *Aggregator22) buildFilesInBackground(ctx context.Context, step uint64,
}
}()
a.integrateFiles(sf, step*a.aggregationStep, (step+1)*a.aggregationStep)
log.Info("[snapshots] history build done", "step", fmt.Sprintf("%d-%d", step, step+1))
closeAll = false
return nil

View File

@ -24,6 +24,7 @@ import (
"fmt"
"os"
"path/filepath"
"strings"
"github.com/ledgerwatch/log/v3"
@ -270,7 +271,16 @@ func (h *History) staticFilesInRange(r HistoryRanges) (indexFiles, historyFiles
}
}
if r.index && len(indexFiles) != len(historyFiles) {
log.Warn("something wrong with files for merge", "idx", fmt.Sprintf("%+v", indexFiles), "hist", fmt.Sprintf("%+v", historyFiles))
var sIdx, sHist []string
for _, f := range indexFiles {
_, fName := filepath.Split(f.index.FilePath())
sIdx = append(sIdx, fmt.Sprintf("%+v", fName))
}
for _, f := range historyFiles {
_, fName := filepath.Split(f.decompressor.FilePath())
sHist = append(sHist, fmt.Sprintf("%+v", fName))
}
log.Warn("something wrong with files for merge", "idx", strings.Join(sIdx, ","), "hist", strings.Join(sHist, ","))
}
}
return