Skip to content

Commit

Permalink
Merge branch 'main' of github.com:ledgerwatch/erigon into astrid-more…
Browse files Browse the repository at this point in the history
…-ignoreable-peer-errs-on-tip-events
  • Loading branch information
taratorio committed Sep 10, 2024
2 parents cf089a7 + 4a9b166 commit 285009d
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-cd-main-branch-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ run-name: "Commit id ${{ github.sha }}: CI-CD build and deploy docker images bas

env:
APPLICATION: "erigon"
BUILDER_IMAGE: "golang:1.22.6-alpine3.20"
TARGET_BASE_IMAGE: "alpine:3.20.2"
BUILDER_IMAGE: "golang:1.22.7-alpine3.20"
TARGET_BASE_IMAGE: "alpine:3.20.3"
APP_REPO: "erigontech/erigon"
CHECKOUT_REF: "main"
DOCKERHUB_REPOSITORY: "erigontech/erigon"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Release

env:
APPLICATION: "erigon"
BUILDER_IMAGE: "ghcr.io/goreleaser/goreleaser-cross:v1.21.13"
DOCKER_BASE_IMAGE: "alpine:3.20.2"
BUILDER_IMAGE: "ghcr.io/goreleaser/goreleaser-cross:v1.22.7"
DOCKER_BASE_IMAGE: "alpine:3.20.3"
APP_REPO: "erigontech/erigon"
PACKAGE: "github.com/erigontech/erigon"
DOCKERHUB_REPOSITORY: "erigontech/erigon"
Expand Down
16 changes: 9 additions & 7 deletions erigon-lib/kv/rawdbv3/txnum.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,14 @@ func (TxNumsReader) Last(tx kv.Tx) (blockNum, txNum uint64, err error) {
}
defer c.Close()

lastK, lastV, err := c.Last()
k, v, err := c.Last()
if err != nil {
return 0, 0, err
}
if lastK == nil || lastV == nil {
if k == nil || v == nil {
return 0, 0, nil
}
return binary.BigEndian.Uint64(lastK), binary.BigEndian.Uint64(lastV), nil
return binary.BigEndian.Uint64(k), binary.BigEndian.Uint64(v), nil
}
func (TxNumsReader) First(tx kv.Tx) (blockNum, txNum uint64, err error) {
c, err := tx.Cursor(kv.MaxTxNum)
Expand All @@ -253,14 +253,14 @@ func (TxNumsReader) First(tx kv.Tx) (blockNum, txNum uint64, err error) {
}
defer c.Close()

lastK, lastV, err := c.First()
k, v, err := c.First()
if err != nil {
return 0, 0, err
}
if lastK == nil || lastV == nil {
if k == nil || v == nil {
return 0, 0, nil
}
return binary.BigEndian.Uint64(lastK), binary.BigEndian.Uint64(lastV), nil
return binary.BigEndian.Uint64(k), binary.BigEndian.Uint64(v), nil
}

// LastKey
Expand Down Expand Up @@ -355,7 +355,9 @@ func (i *MapTxNum2BlockNumIter) Next() (txNum, blockNum uint64, txIndex int, isF
return
}
if !ok {
return txNum, i.blockNum, txIndex, isFinalTxn, blockNumChanged, fmt.Errorf("can't find blockNumber by txnID=%d", txNum)
_lb, _lt, _ := i.txNumsReader.Last(i.tx)
_fb, _ft, _ := i.txNumsReader.First(i.tx)
return txNum, i.blockNum, txIndex, isFinalTxn, blockNumChanged, fmt.Errorf("can't find blockNumber by txnID=%d; last in db: (%d-%d, %d-%d)", txNum, _fb, _lb, _ft, _lt)
}
}
blockNum = i.blockNum
Expand Down
3 changes: 0 additions & 3 deletions erigon-lib/kv/stream/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ func (it *ArrStream[V]) NextBatch() ([]V, error) {
}

func Range[T constraints.Integer](from, to T) *RangeIter[T] {
if from == to {
to++
}
return &RangeIter[T]{i: from, to: to}
}

Expand Down
2 changes: 1 addition & 1 deletion erigon-lib/kv/stream/stream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func TestRange(t *testing.T) {
s1 := stream.Range[uint64](1, 1)
res, err := stream.ToArray[uint64](s1)
require.NoError(t, err)
require.Equal(t, []uint64{1}, res)
require.Empty(t, res)
})
}

Expand Down
6 changes: 3 additions & 3 deletions turbo/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,12 @@ func ApplyFlagsForEthConfig(ctx *cli.Context, cfg *ethconfig.Config, logger log.
// Full mode prunes all but the latest state
if ctx.String(PruneModeFlag.Name) == "full" {
mode.Blocks = prune.Distance(math.MaxUint64)
mode.History = prune.Distance(0)
mode.History = prune.Distance(config3.DefaultPruneDistance)
}
// Minimal mode prunes all but the latest state including blocks
if ctx.String(PruneModeFlag.Name) == "minimal" {
mode.Blocks = prune.Distance(2048) // 2048 is just some blocks to allow reorgs
mode.History = prune.Distance(0)
mode.Blocks = prune.Distance(config3.DefaultPruneDistance)
mode.History = prune.Distance(config3.DefaultPruneDistance)
}

if err != nil {
Expand Down

0 comments on commit 285009d

Please sign in to comment.