Skip to content

Commit

Permalink
Merge branch 'erigontech:main' into curl
Browse files Browse the repository at this point in the history
  • Loading branch information
tornadocontrib authored Jan 15, 2025
2 parents bf7cc0f + 608205b commit 18a8c28
Show file tree
Hide file tree
Showing 69 changed files with 8,996 additions and 2,704 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/backups-dashboards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
strategy:
matrix:
# For each dashboard add an entry in the list here below (and add an entry in the dictionary within the backup script too!)
dashboard: [erigon_custom_metrics]
dashboard: [erigon_custom_metrics,erigonQA]
env:
DASHBOARDS_AUTH_TOKEN: ${{ secrets.DASHBOARDS_AUTH_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- reopened
- synchronize
- ready_for_review

workflow_dispatch:

concurrency:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-caplin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- reopened
- synchronize
- ready_for_review

jobs:
tests:
strategy:
Expand Down
90 changes: 73 additions & 17 deletions .github/workflows/test-integration-erigon.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Integration tests - ERIGON

on:
push:
branches:
Expand All @@ -17,59 +18,114 @@ on:
workflow_dispatch:

jobs:
#
# This first job is used to determine if changes are within out-of-scope dirs or files (in such a case integration tests are not run because they would be meaningless)
# NOTE: this logic is needed because the simple 'paths-ignore:' doesn't work since this workflow is set as a mandatory/required check for this repo
# - '**/.github/workflows/**' is currently commented to avoid unintended freeze in case of concurrent changes outside the excluded paths (further development will be done in due course)
#
source-of-changes:
runs-on: ubuntu-latest
outputs:
changed_files: ${{ steps.filter.outputs.changed_files }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Check for changes within out-of-scope dirs or files
id: filter
uses: dorny/paths-filter@v3
with:
filters: |
changed_files:
- 'dashboards/**'
# - '**/.github/workflows/**'
- '**/.github/workflows/backups-dashboards.yml'
tests-mac-linux:
needs: source-of-changes
strategy:
matrix:
# list of os: https://github.com/actions/virtual-environments
os:
- ubuntu-22.04
- macos-14
- ubuntu-latest-erigontests-large
# - ubuntu-latest-erigontests-large
runs-on: ${{ matrix.os }}

steps:
- name: declaring runners
- name: Declare runners
if: needs.source-of-changes.outputs.changed_files != 'true'
run: |
set +x
echo "I am being served by this runner: $RUNNER_NAME"
- uses: actions/checkout@v4
- run: git submodule update --init --recursive --force
- uses: actions/setup-go@v5
- name: Checkout code
if: needs.source-of-changes.outputs.changed_files != 'true'
uses: actions/checkout@v4

- name: Update submodules
if: needs.source-of-changes.outputs.changed_files != 'true'
run: git submodule update --init --recursive --force

- name: Setup Go environment
if: needs.source-of-changes.outputs.changed_files != 'true'
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: ${{ contains(fromJSON('["refs/heads/main","refs/heads/release/2.60","refs/heads/release/2.61"]'), github.ref) }}

- name: Install dependencies on Linux
if: runner.os == 'Linux'
if: runner.os == 'Linux' && needs.source-of-changes.outputs.changed_files != 'true'
run: sudo apt update && sudo apt install build-essential
- name: test-integration

- name: Run integration tests on ${{ matrix.os }}
if: needs.source-of-changes.outputs.changed_files != 'true'
run: GOGC=80 make test-integration

- name: This ${{ matrix.os }} check does not make sense for changes within out-of-scope directories
if: needs.source-of-changes.outputs.changed_files == 'true'
run: echo "This check does not make sense for changes within out-of-scope directories"


tests-windows:
needs: source-of-changes
strategy:
matrix:
os: [ windows-2022 ]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- run: git submodule update --init --recursive --force
- uses: actions/setup-go@v5
- name: Checkout code on ${{ matrix.os }}
if: needs.source-of-changes.outputs.changed_files != 'true'
uses: actions/checkout@v4

- name: Update submodules on Windows
if: needs.source-of-changes.outputs.changed_files != 'true'
run: git submodule update --init --recursive --force

- name: Setup Go environment on ${{ matrix.os }}
if: needs.source-of-changes.outputs.changed_files != 'true'
uses: actions/setup-go@v5
with:
go-version: '1.23'

- uses: actions/cache@v4
- name: Cache Chocolatey packages
if: needs.source-of-changes.outputs.changed_files != 'true'
uses: actions/cache@v4
with:
path: |
C:\ProgramData\chocolatey\lib\mingw
C:\ProgramData\chocolatey\lib\cmake
key: chocolatey-${{ matrix.os }}
- name: Install dependencies

- name: Install dependencies on ${{ matrix.os }}
if: needs.source-of-changes.outputs.changed_files != 'true'
run: |
choco upgrade mingw -y --no-progress --version 13.2.0
- name: test-integration
- name: Run integration tests on ${{ matrix.os }}
if: needs.source-of-changes.outputs.changed_files != 'true'
run: .\wmake.ps1 test-integration




- name: This ${{ matrix.os }} check does not make sense for changes within out-of-scope directories
if: needs.source-of-changes.outputs.changed_files == 'true'
run: echo "This check does not make sense for changes within out-of-scope directories"
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Erigon

Documentation: **[docs.erigon.tech](https://docs.erigon.tech)**
Blog: **[erigon.substack.com](https://erigon.substack.com/)**
Twitter: [x.com/ErigonEth](https://x.com/ErigonEth)
Blog: **[erigon.tech/news](https://erigon.tech/news/)**
X/Twitter: **[x.com/ErigonEth](https://x.com/ErigonEth)**

Erigon is an implementation of Ethereum (execution layer with embeddable consensus layer), on the efficiency
frontier.
Expand Down Expand Up @@ -722,14 +722,6 @@ Getting in touch
The main discussions are happening on our Discord server. To get an invite, send an email to `bloxster [at] proton.me`
with your name, occupation, a brief explanation of why you want to join the Discord, and how you heard about Erigon.
### Blog
**[erigon.substack.com](https://erigon.substack.com/)**
### Twitter
[x.com/ErigonEth](https://x.com/ErigonEth)
### Reporting security issues/concerns
Send an email to `security [at] torquem.ch`.
Expand Down
12 changes: 11 additions & 1 deletion cl/monitor/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ var (
batchVerificationThroughput = metrics.GetOrCreateGauge("aggregation_per_signature")
blobVerificationTime = metrics.GetOrCreateGauge("blob_verification_time")
executionTime = metrics.GetOrCreateGauge("execution_time")
executionClientInsertingBlocks = metrics.GetOrCreateGauge("execution_client_insert_blocks_time")
executionClientValidateChain = metrics.GetOrCreateGauge("execution_client_validate_chain_time")

// Epoch processing metrics
EpochProcessingTime = metrics.GetOrCreateGauge("epoch_processing_time")
Expand Down Expand Up @@ -223,6 +225,14 @@ func ObserveBlobVerificationTime(startTime time.Time) {
blobVerificationTime.Set(microToMilli(time.Since(startTime).Microseconds()))
}

func ObserveExecutionTime(startTime time.Time) {
func ObserveNewPayloadTime(startTime time.Time) {
executionTime.Set(microToMilli(time.Since(startTime).Microseconds()))
}

func ObserveExecutionClientInsertingBlocks(startTime time.Time) {
executionClientInsertingBlocks.Set(microToMilli(time.Since(startTime).Microseconds()))
}

func ObserveExecutionClientValidateChain(startTime time.Time) {
executionClientValidateChain.Set(microToMilli(time.Since(startTime).Microseconds()))
}
6 changes: 6 additions & 0 deletions cl/phase1/execution_client/execution_client_direct.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ import (
"errors"
"fmt"
"math/big"
"time"

libcommon "github.com/erigontech/erigon-lib/common"
"github.com/erigontech/erigon-lib/common/hexutility"
execution "github.com/erigontech/erigon-lib/gointerfaces/executionproto"
"github.com/erigontech/erigon/cl/cltypes"
"github.com/erigontech/erigon/cl/monitor"
"github.com/erigontech/erigon/core/types"
"github.com/erigontech/erigon/turbo/engineapi/engine_types"
"github.com/erigontech/erigon/turbo/execution/eth1/eth1_chain_reader"
Expand Down Expand Up @@ -66,20 +68,24 @@ func (cc *ExecutionClientDirect) NewPayload(
return PayloadStatusInvalidated, err
}

startInsertBlockAndWait := time.Now()
if err := cc.chainRW.InsertBlockAndWait(ctx, types.NewBlockFromStorage(payload.BlockHash, header, txs, nil, body.Withdrawals)); err != nil {
return PayloadStatusNone, err
}
monitor.ObserveExecutionClientInsertingBlocks(startInsertBlockAndWait)

headHeader := cc.chainRW.CurrentHeader(ctx)
if headHeader == nil || header.Number.Uint64() > headHeader.Number.Uint64()+1 {
// can't validate yet
return PayloadStatusNotValidated, nil
}

startValidateChain := time.Now()
status, _, _, err := cc.chainRW.ValidateChain(ctx, payload.BlockHash, payload.BlockNumber)
if err != nil {
return PayloadStatusNone, err
}
monitor.ObserveExecutionClientValidateChain(startValidateChain)
// check status
switch status {
case execution.ExecutionStatus_BadBlock, execution.ExecutionStatus_InvalidForkchoice:
Expand Down
4 changes: 2 additions & 2 deletions cl/phase1/forkchoice/on_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ func (f *ForkChoiceStore) ProcessBlockExecution(ctx context.Context, block *clty

timeStartExec := time.Now()
payloadStatus, err := f.engine.NewPayload(ctx, block.Block.Body.ExecutionPayload, &block.Block.ParentRoot, versionedHashes, executionRequestsList)
monitor.ObserveNewPayloadTime(timeStartExec)
switch payloadStatus {
case execution_client.PayloadStatusInvalidated:
log.Warn("OnBlock: block is invalid", "block", libcommon.Hash(blockRoot), "err", err)
Expand All @@ -135,7 +136,6 @@ func (f *ForkChoiceStore) ProcessBlockExecution(ctx context.Context, block *clty
if err != nil {
return fmt.Errorf("newPayload failed: %v", err)
}
monitor.ObserveExecutionTime(timeStartExec)
return nil
}

Expand Down Expand Up @@ -213,6 +213,7 @@ func (f *ForkChoiceStore) OnBlock(ctx context.Context, block *cltypes.SignedBeac
}
timeStartExec := time.Now()
payloadStatus, err := f.engine.NewPayload(ctx, block.Block.Body.ExecutionPayload, &block.Block.ParentRoot, versionedHashes, executionRequestsList)
monitor.ObserveNewPayloadTime(timeStartExec)
switch payloadStatus {
case execution_client.PayloadStatusNotValidated:
log.Debug("OnBlock: block is not validated yet", "block", libcommon.Hash(blockRoot))
Expand All @@ -239,7 +240,6 @@ func (f *ForkChoiceStore) OnBlock(ctx context.Context, block *cltypes.SignedBeac
if err != nil {
return fmt.Errorf("newPayload failed: %v", err)
}
monitor.ObserveExecutionTime(timeStartExec)
}
log.Trace("OnBlock: engine", "elapsed", time.Since(startEngine))
startStateProcess := time.Now()
Expand Down
4 changes: 2 additions & 2 deletions cl/phase1/network/services/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const (
blobJobsIntervalTick = 5 * time.Millisecond
singleAttestationIntervalTick = 10 * time.Millisecond
attestationJobsIntervalTick = 100 * time.Millisecond
blockJobExpiry = 4 * time.Second
blobJobExpiry = 4 * time.Second
blockJobExpiry = 30 * time.Second
blobJobExpiry = 30 * time.Second
attestationJobExpiry = 30 * time.Minute
singleAttestationJobExpiry = 6 * time.Second
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/prometheus/dashboards/erigon_internals.json
Original file line number Diff line number Diff line change
Expand Up @@ -1582,7 +1582,7 @@
}
}
],
"title": "ValidateChain: time spent",
"title": "NewPayload: time spent",
"type": "timeseries"
},
{
Expand Down
2 changes: 1 addition & 1 deletion cmd/rpcdaemon/cli/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func RootCommand() (*cobra.Command, *httpcfg.HttpCfg) {
rootCmd.PersistentFlags().BoolVar(&cfg.GraphQLEnabled, "graphql", false, "enables graphql endpoint (disabled by default)")
rootCmd.PersistentFlags().Uint64Var(&cfg.Gascap, "rpc.gascap", 50_000_000, "Sets a cap on gas that can be used in eth_call/estimateGas")
rootCmd.PersistentFlags().Uint64Var(&cfg.MaxTraces, "trace.maxtraces", 200, "Sets a limit on traces that can be returned in trace_filter")
rootCmd.PersistentFlags().BoolVar(&polygonSync, "polygon.sync", false, "Enable if Erigon has been synced using the new polygon sync component")
rootCmd.PersistentFlags().BoolVar(&polygonSync, "polygon.sync", true, "Enable if Erigon has been synced using the new polygon sync component")

rootCmd.PersistentFlags().StringVar(&cfg.RpcAllowListFilePath, utils.RpcAccessListFlag.Name, "", "Specify granular (method-by-method) API allowlist")
rootCmd.PersistentFlags().UintVar(&cfg.RpcBatchConcurrency, utils.RpcBatchConcurrencyFlag.Name, 2, utils.RpcBatchConcurrencyFlag.Usage)
Expand Down
10 changes: 10 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -788,12 +788,14 @@ var (
Usage: "Ignore the bor block period and wait for 'blocksize' transactions (for testing purposes)",
}

// TODO - this is a depricated flag - should be removed
WithHeimdallMilestones = cli.BoolFlag{
Name: "bor.milestone",
Usage: "Enabling bor milestone processing",
Value: true,
}

// TODO - this is a depricated flag - should be removed
WithHeimdallWaypoints = cli.BoolFlag{
Name: "bor.waypoints",
Usage: "Enabling bor waypont recording",
Expand All @@ -803,8 +805,10 @@ var (
PolygonSyncFlag = cli.BoolFlag{
Name: "polygon.sync",
Usage: "Enabling syncing using the new polygon sync component",
Value: true,
}

// TODO - this is a depricated flag - should be removed
PolygonSyncStageFlag = cli.BoolFlag{
Name: "polygon.sync.stage",
Usage: "Enabling syncing with a stage that uses the polygon sync component",
Expand Down Expand Up @@ -1693,6 +1697,12 @@ func setBorConfig(ctx *cli.Context, cfg *ethconfig.Config, nodeConfig *nodecfg.C
cfg.WithHeimdallWaypointRecording = ctx.Bool(WithHeimdallWaypoints.Name)
cfg.PolygonSync = ctx.Bool(PolygonSyncFlag.Name)
cfg.PolygonSyncStage = ctx.Bool(PolygonSyncStageFlag.Name)

if cfg.PolygonSync {
cfg.WithHeimdallMilestones = false
cfg.WithHeimdallWaypointRecording = true
}

heimdall.RecordWayPoints(cfg.WithHeimdallWaypointRecording || cfg.PolygonSync || cfg.PolygonSyncStage)

chainConfig := params.ChainConfigByChainName(ctx.String(ChainFlag.Name))
Expand Down
Loading

0 comments on commit 18a8c28

Please sign in to comment.