Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement boosted catch-up sync with cfx_getLogs #256

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ sync:
# maxDbRows: 7500
# # Capacity of channel per worker to buffer queried epoch data
# workerChanSize: 5
# # Max memory usage allowed in bytes (0 for no limit).
# memoryThreshold: 0
# # Whether to enable benchmark.
# benchmark: false


# # EVM space sync configurations
# eth:
Expand Down Expand Up @@ -454,4 +459,4 @@ node:
# # Switch to turn on/off pprof
# enabled: false
# # The endpoint to start a http server for pprof
# httpEndpoint: ":6060"
# httpEndpoint: ":6060"
2 changes: 1 addition & 1 deletion store/epoch_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ func queryEpochData(cfx sdk.ClientOperator, epochNumber uint64, useBatch bool) (
}

func validateBlock(block *types.Block, epochNumber uint64, hash types.Hash) error {
if block.GasUsed == nil { // block is not executed yet?
if epochNumber != 0 && block.GasUsed == nil { // block is not executed yet?
return errors.WithMessage(errBlockValidationFailed, "gas used is nil")
}

Expand Down
7 changes: 1 addition & 6 deletions store/mysql/store_log_addr.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/Conflux-Chain/confura/store"
"github.com/Conflux-Chain/confura/util"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"gorm.io/gorm"
)

Expand Down Expand Up @@ -84,11 +83,7 @@ func (ls *AddressIndexedLogStore) convertToPartitionedLogs(

receipt, ok := data.Receipts[tx.Hash]
if !ok {
// should never occur, just to ensure code robust
logrus.WithFields(logrus.Fields{
"epoch": data.Number,
"tx": tx.Hash,
}).Error("Cannot find transaction receipt in epoch data")
// This could happen if there are no event logs for this transaction.
continue
}

Expand Down
Loading
Loading