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

chore: update pebble #16

Open
wants to merge 2 commits into
base: feat-ckpt
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
2 changes: 2 additions & 0 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1834,6 +1834,8 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error)
err error
)

time.Sleep(1 * time.Second)

// skip block process if we already have the state, receipts and logs from mining work
if !(receiptExist && logExist && stateExist) {
// Retrieve the parent block and it's state to execute on top
Expand Down
10 changes: 6 additions & 4 deletions ethdb/pebble/pebble.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@
func (l panicLogger) Infof(format string, args ...interface{}) {
}

func (l panicLogger) Errorf(format string, args ...interface{}) {
}

func (l panicLogger) Fatalf(format string, args ...interface{}) {
panic(errors.Errorf("fatal: "+format, args...))
}
Expand Down Expand Up @@ -598,8 +601,8 @@
func (b *batch) Replay(w ethdb.KeyValueWriter) error {
reader := b.b.Reader()
for {
kind, k, v, ok := reader.Next()
if !ok {
kind, k, v, ok, err := reader.Next()

Check failure on line 604 in ethdb/pebble/pebble.go

View workflow job for this annotation

GitHub Actions / unit_test

assignment mismatch: 5 variables but reader.Next returns 4 values
if !ok || err != nil {
break
}
// The (k,v) slices might be overwritten if the batch is reset/reused,
Expand Down Expand Up @@ -670,7 +673,6 @@

func (d *Database) NewCheckpoint(destDir string) error {
var opts []pebble.CheckpointOption
opt := pebble.WithFlushedWAL()
opts = append(opts, opt)
opts = append(opts, pebble.WithFlushedWAL(), pebble.ConcurrentLinkOrCopy(10))

Check failure on line 676 in ethdb/pebble/pebble.go

View workflow job for this annotation

GitHub Actions / unit_test

undefined: pebble.ConcurrentLinkOrCopy
return d.db.Checkpoint(destDir, opts...)
}
14 changes: 9 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/btcsuite/btcd/btcec/v2 v2.3.2
github.com/cespare/cp v1.1.1
github.com/cloudflare/cloudflare-go v0.79.0
github.com/cockroachdb/errors v1.9.1
github.com/cockroachdb/errors v1.11.1
github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593
github.com/cometbft/cometbft v0.37.2
github.com/consensys/gnark-crypto v0.12.1
Expand Down Expand Up @@ -72,7 +72,7 @@ require (
golang.org/x/crypto v0.18.0
golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611
golang.org/x/sync v0.5.0
golang.org/x/sys v0.16.0
golang.org/x/sys v0.17.0
golang.org/x/text v0.14.0
golang.org/x/time v0.3.0
golang.org/x/tools v0.16.0
Expand All @@ -83,7 +83,7 @@ require (
require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
github.com/DataDog/zstd v1.5.2 // indirect
github.com/DataDog/zstd v1.5.6-0.20230824185856-869dae002e5e // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37 // indirect
Expand All @@ -98,7 +98,8 @@ require (
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/redact v1.1.3 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/swiss v0.0.0-20240303172742-c161743eb608 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/cosmos/gogoproto v1.4.11 // indirect
Expand Down Expand Up @@ -181,6 +182,9 @@ require (
rsc.io/tmplfunc v0.0.3 // indirect
)

replace github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v1.0.0
replace (
github.com/cockroachdb/pebble => github.com/will-2012/pebble v0.0.0-20240329130540-bfc352d618bd
github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v1.0.0
)

//replace github.com/ethereum-optimism/superchain-registry/superchain => ../superchain-registry/superchain
Loading
Loading