Skip to content

Commit

Permalink
Revert "release 2.55: Revert PR 8829 (erigontech#8896)"
Browse files Browse the repository at this point in the history
This reverts commit b39f324.
and this recovers erigontech#8829

Co-Authored-By: battlmonstr <11477595+battlmonstr@users.noreply.github.com>
  • Loading branch information
ImTei and battlmonstr committed Apr 5, 2024
1 parent 27617b0 commit ecad027
Show file tree
Hide file tree
Showing 16 changed files with 74 additions and 394 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
strategy:
matrix:
os: [ ubuntu-20.04, macos-11 ] # list of os: https://github.com/actions/virtual-environments
os: [ ubuntu-22.04, macos-13-xlarge ] # list of os: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }}

steps:
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
docker-build-check:
# don't run this on devel - the PR must have run it to be merged and it misleads that this pushes the docker image
if: (${{ github.event_name == 'push' || !github.event.pull_request.draft }}) && ${{ github.ref != 'refs/heads/devel' }}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: AutoModality/action-clean@v1
- uses: actions/checkout@v3
Expand All @@ -129,7 +129,7 @@ jobs:

# automated-tests:
# runs-on:
# ubuntu-20.04
# ubuntu-22.04
# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
# steps:
# - uses: actions/checkout@v3
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test-integration-caplin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:
strategy:
matrix:
# disable macos-11 until https://github.com/ledgerwatch/erigon/issues/8789
# os: [ ubuntu-20.04, macos-11 ] # list of os: https://github.com/actions/virtual-environments
os: [ ubuntu-20.04 ] # list of os: https://github.com/actions/virtual-environments
os: [ ubuntu-22.04 ] # list of os: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }}

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
tests:
strategy:
matrix:
os: [ ubuntu-20.04, macos-11 ] # list of os: https://github.com/actions/virtual-environments
os: [ ubuntu-22.04, macos-13-xlarge ] # list of os: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }}

steps:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ADD . .
RUN --mount=type=cache,target=/root/.cache \
--mount=type=cache,target=/tmp/go-build \
--mount=type=cache,target=/go/pkg/mod \
make all
make BUILD_TAGS=nosqlite,noboltdb,nosilkworm all


FROM docker.io/library/golang:1.20-alpine3.17 AS tools-builder
Expand Down
11 changes: 2 additions & 9 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -909,11 +909,6 @@ var (
Usage: "Comma separated list of support session ids to connect to",
}

SilkwormLibraryPathFlag = cli.StringFlag{
Name: "silkworm.libpath",
Usage: "Path to the Silkworm library",
Value: "",
}
SilkwormExecutionFlag = cli.BoolFlag{
Name: "silkworm.exec",
Usage: "Enable Silkworm block execution",
Expand All @@ -926,6 +921,7 @@ var (
Name: "silkworm.sentry",
Usage: "Enable embedded Silkworm Sentry service",
}

BeaconAPIFlag = cli.BoolFlag{
Name: "beacon.api",
Usage: "Enable beacon API",
Expand Down Expand Up @@ -1640,10 +1636,7 @@ func setCaplin(ctx *cli.Context, cfg *ethconfig.Config) {
}

func setSilkworm(ctx *cli.Context, cfg *ethconfig.Config) {
cfg.SilkwormLibraryPath = ctx.String(SilkwormLibraryPathFlag.Name)
if ctx.IsSet(SilkwormExecutionFlag.Name) {
cfg.SilkwormExecution = ctx.Bool(SilkwormExecutionFlag.Name)
}
cfg.SilkwormExecution = ctx.Bool(SilkwormExecutionFlag.Name)
cfg.SilkwormRpcDaemon = ctx.Bool(SilkwormRpcDaemonFlag.Name)
cfg.SilkwormSentry = ctx.Bool(SilkwormSentryFlag.Name)
}
Expand Down
12 changes: 7 additions & 5 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ func New(ctx context.Context, stack *node.Node, config *ethconfig.Config, logger

backend.gasPrice, _ = uint256.FromBig(config.Miner.GasPrice)

if config.SilkwormLibraryPath != "" {
backend.silkworm, err = silkworm.New(config.SilkwormLibraryPath, config.Dirs.DataDir)
if config.SilkwormExecution || config.SilkwormRpcDaemon || config.SilkwormSentry {
backend.silkworm, err = silkworm.New(config.Dirs.DataDir)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -403,7 +403,7 @@ func New(ctx context.Context, stack *node.Node, config *ethconfig.Config, logger
MaxPeers: p2pConfig.MaxPeers,
}

silkwormSentryService := backend.silkworm.NewSentryService(settings)
silkwormSentryService := silkworm.NewSentryService(backend.silkworm, settings)
backend.silkwormSentryService = &silkwormSentryService

sentryClient, err := sentry_multi_client.GrpcClient(backend.sentryCtx, apiAddr)
Expand Down Expand Up @@ -980,7 +980,7 @@ func (s *Ethereum) Init(stack *node.Node, config *ethconfig.Config) error {
s.apiList = jsonrpc.APIList(chainKv, ethRpcClient, txPoolRpcClient, miningRpcClient, ff, stateCache, blockReader, s.agg, &httpRpcCfg, s.engine, s.seqRPCService, s.historicalRPCService, s.logger)

if config.SilkwormRpcDaemon && httpRpcCfg.Enabled {
silkwormRPCDaemonService := s.silkworm.NewRpcDaemonService(chainKv)
silkwormRPCDaemonService := silkworm.NewRpcDaemonService(s.silkworm, chainKv)
s.silkwormRPCDaemonService = &silkwormRPCDaemonService
} else {
go func() {
Expand Down Expand Up @@ -1462,7 +1462,9 @@ func (s *Ethereum) Stop() error {
}
}
if s.silkworm != nil {
s.silkworm.Close()
if err := s.silkworm.Close(); err != nil {
s.logger.Error("silkworm.Close error", "err", err)
}
}

return nil
Expand Down
10 changes: 3 additions & 7 deletions eth/ethconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ var Defaults = Config{
KeepBlocks: false,
Produce: true,
},

// applies if SilkwormLibraryPath is set
SilkwormExecution: true,
}

func init() {
Expand Down Expand Up @@ -269,10 +266,9 @@ type Config struct {
ForcePartialCommit bool

// Embedded Silkworm support
SilkwormLibraryPath string
SilkwormExecution bool
SilkwormRpcDaemon bool
SilkwormSentry bool
SilkwormExecution bool
SilkwormRpcDaemon bool
SilkwormSentry bool

DisableTxPoolGossip bool

Expand Down
2 changes: 1 addition & 1 deletion eth/stagedsync/stage_execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ Loop:

_, isMemoryMutation := tx.(*membatchwithdb.MemoryMutation)
if cfg.silkworm != nil && !isMemoryMutation {
blockNum, err = cfg.silkworm.ExecuteBlocks(tx, cfg.chainConfig.ChainID, blockNum, to, uint64(cfg.batchSize), writeChangeSets, writeReceipts, writeCallTraces)
blockNum, err = silkworm.ExecuteBlocks(cfg.silkworm, tx, cfg.chainConfig.ChainID, blockNum, to, uint64(cfg.batchSize), writeChangeSets, writeReceipts, writeCallTraces)
} else {
err = executeBlock(block, tx, batch, cfg, *cfg.vmConfig, writeChangeSets, writeReceipts, writeCallTraces, initialCycle, stateStream, logger)
}
Expand Down
33 changes: 5 additions & 28 deletions params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,47 +29,24 @@ var (
GitTag string
)

// Version is the version of upstream erigon
// see https://calver.org
const (
VersionMajor = 2 // Major version component of the current release
VersionMinor = 56 // Minor version component of the current release
VersionMicro = 2 // Patch version component of the current release
VersionModifier = "" // Modifier component of the current release
VersionMajor = 2 // Major version component of the current release
VersionMinor = 38 // Minor version component of the current release
VersionMicro = 0 // Patch version component of the current release
VersionModifier = "stable" // Modifier component of the current release
VersionKeyCreated = "ErigonVersionCreated"
VersionKeyFinished = "ErigonVersionFinished"
)

// OPVersion is the version of op-erigon
const (
OPVersionMajor = 0 // Major version component of the current release
OPVersionMinor = 5 // Minor version component of the current release
OPVersionMicro = 0 // Patch version component of the current release
OPVersionModifier = "unstable" // Version metadata to append to the version string
)

// Version holds the textual version string.
var Version = func() string {
return fmt.Sprintf("%d.%02d.%d", OPVersionMajor, OPVersionMinor, OPVersionMicro)
return fmt.Sprintf("%d.%02d.%d", VersionMajor, VersionMinor, VersionMicro)
}()

// VersionWithMeta holds the textual version string including the metadata.
var VersionWithMeta = func() string {
v := Version
if OPVersionModifier != "" {
v += "-" + OPVersionModifier
}
return v
}()

// ErigonVersion holds the textual erigon version string.
var ErigonVersion = func() string {
return fmt.Sprintf("%d.%d.%d", VersionMajor, VersionMinor, VersionMicro)
}()

// ErigonVersionWithMeta holds the textual erigon version string including the metadata.
var ErigonVersionWithMeta = func() string {
v := ErigonVersion
if VersionModifier != "" {
v += "-" + VersionModifier
}
Expand Down
1 change: 0 additions & 1 deletion turbo/cli/default_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ var DefaultFlags = []cli.Flag{
&utils.GenesisPathFlag,
&utils.OtsSearchMaxCapFlag,

&utils.SilkwormLibraryPathFlag,
&utils.SilkwormExecutionFlag,
&utils.SilkwormRpcDaemonFlag,
&utils.SilkwormSentryFlag,
Expand Down
37 changes: 0 additions & 37 deletions turbo/silkworm/load_unix.go

This file was deleted.

16 changes: 0 additions & 16 deletions turbo/silkworm/load_windows.go

This file was deleted.

1 change: 1 addition & 0 deletions turbo/silkworm/silkworm.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/erigontech/silkworm-go"
"github.com/ledgerwatch/erigon-lib/kv"
"github.com/ledgerwatch/erigon/consensus"
"math/big"
)

type Silkworm = silkworm_go.Silkworm
Expand Down
Loading

0 comments on commit ecad027

Please sign in to comment.