Skip to content

Commit

Permalink
Merge pull request #471 from blxdyx/upsteam_alpha2
Browse files Browse the repository at this point in the history
  • Loading branch information
setunapo authored Aug 7, 2024
2 parents ba4a165 + 6f14cc6 commit afa66f1
Show file tree
Hide file tree
Showing 543 changed files with 11,191 additions and 11,059 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Install dependencies on Linux
Expand All @@ -58,7 +58,7 @@ jobs:
- name: Install golangci-lint
if: runner.os == 'Linux'
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6
with:
version: v1.59.1
skip-build-cache: true
Expand All @@ -73,7 +73,7 @@ jobs:

- name: SonarCloud
if: runner.os == 'Linux'
uses: SonarSource/sonarcloud-github-action@v2.1.1
uses: SonarSource/sonarcloud-github-action@v2.3.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand All @@ -92,11 +92,11 @@ jobs:
# with:
# minimum-size: 8GB
# - uses: actions/checkout@v4
# - uses: actions/setup-go@v4
# - uses: actions/setup-go@v5
# with:
# go-version: '1.21'

# - uses: actions/cache@v3
# - uses: actions/cache@v4
# with:
# path: |
# C:\ProgramData\chocolatey\lib\mingw
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docker-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ jobs:
fetch-depth: 0

- name: dockerhub-login
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB }}
password: ${{ secrets.DOCKERHUB_KEY }}
- name: ghcr-login
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/setup-qemu-action@v2
- uses: docker/setup-qemu-action@v3

- run: |
make release-dry-run
Expand All @@ -38,4 +38,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${GITHUB_REF#refs/tags/}
DOCKER_USERNAME: ${{ secrets.DOCKERHUB }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_KEY }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_KEY }}
4 changes: 2 additions & 2 deletions .github/workflows/hive-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
done
- name: parse hive results
uses: phoenix-actions/test-reporting@v10
uses: phoenix-actions/test-reporting@v15
with:
name: Tests
path: results-${{ github.run_id }}/*.xml
reporter: java-junit
reporter: java-junit
6 changes: 3 additions & 3 deletions .github/workflows/qa-sync-from-scratch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ on:
jobs:
sync-from-scratch-test:
runs-on: self-hosted
timeout-minutes: 800
timeout-minutes: 1100 # 18 hours plus 20 minutes
strategy:
fail-fast: false
matrix:
chain: [ sepolia, amoy ] # Chain name as specified on the erigon command line
chain: [ sepolia, holesky, amoy ] # Chain name as specified on the erigon command line
env:
ERIGON_DATA_DIR: ${{ github.workspace }}/erigon_data
ERIGON_QA_PATH: /home/qarunner/erigon-qa
TRACKING_TIME_SECONDS: 7200 # 2 hours
TOTAL_TIME_SECONDS: 43200 # 12 hours
TOTAL_TIME_SECONDS: 57600 # 16 hours
CHAIN: ${{ matrix.chain }}

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-erigon-is-library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: git submodule update --init --recursive --force
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Install dependencies on Linux
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-integration-caplin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Install dependencies on Linux
Expand All @@ -42,11 +42,11 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
C:\ProgramData\chocolatey\lib\mingw
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: git submodule update --init --recursive --force
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Install dependencies on Linux
Expand All @@ -48,11 +48,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: git submodule update --init --recursive --force
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
C:\ProgramData\chocolatey\lib\mingw
Expand Down
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ linters:
- errchkjson #TODO: enable me
- unused #TODO: enable me
- testifylint #TODO: enable me
- perfsprint #TODO: enable me
- gocheckcompilerdirectives
- protogetter
enable:
- unconvert
# - predeclared #TODO: enable me
# - thelper #TODO: enable me
# - wastedassign
- wastedassign
- gofmt
- gocritic
- perfsprint
# - revive
# - forcetypeassert
# - stylecheck
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ GOPRIVATE = github.com/erigontech/silkworm-go

PACKAGE = github.com/node-real/bsc-erigon

GO_FLAGS += -trimpath -tags $(BUILD_TAGS) -buildvcs=false
GO_FLAGS += -trimpath -tags $(BUILD_TAGS) -buildvcs=false
GO_FLAGS += -ldflags "-X ${PACKAGE}/params.GitCommit=${GIT_COMMIT} -X ${PACKAGE}/params.GitBranch=${GIT_BRANCH} -X ${PACKAGE}/params.GitTag=${GIT_TAG}"

GOBUILD = CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" GOPRIVATE="$(GOPRIVATE)" $(GO) build $(GO_FLAGS)
Expand Down Expand Up @@ -277,7 +277,7 @@ install:
@ls -al "$(DIST)"

PACKAGE_NAME := github.com/node-real/bsc-erigon
GOLANG_CROSS_VERSION ?= v1.21.6
GOLANG_CROSS_VERSION ?= v1.21.5

.PHONY: release-dry-run
release-dry-run: git-submodules
Expand Down
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Erigon

Documentation: **[erigon.gitbook.io](https://erigon.gitbook.io)**

Erigon is an implementation of Ethereum (execution layer with embeddable consensus layer), on the efficiency
frontier. [Archive Node](https://ethereum.org/en/developers/docs/nodes-and-clients/archive-nodes/#what-is-an-archive-node)
by default.

An accessible and complete version of the documentation is available at **[erigon.gitbook.io](https://erigon.gitbook.io)
**.
<br>

![Build status](https://github.com/erigontech/erigon/actions/workflows/ci.yml/badge.svg) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=erigontech_erigon&metric=coverage)](https://sonarcloud.io/summary/new_code?id=erigontech_erigon)
Expand Down Expand Up @@ -63,7 +63,6 @@ System Requirements

* Polygon Mainnet Archive: 8.5TiB (December 2023).
Polygon Mainnet Full node (see [Pruned Node][pruned_node]) with `--prune.*.older 15768000`: 5.1Tb (September 2023).
Polygon Mumbai Archive: 1TB. (April 2022).

SSD or NVMe. Do not recommend HDD - on HDD Erigon will always stay N blocks behind chain tip, but not fall behind.
Bear in mind that SSD performance deteriorates when close to capacity.
Expand All @@ -82,7 +81,6 @@ Usage

### Getting Started

Building erigon requires both a Go (version 1.21 or later) and a C compiler (GCC 10+ or Clang).
For building the latest release (this will be suitable for most users just wanting to run a node):

```sh
Expand Down Expand Up @@ -111,7 +109,7 @@ download speed by flag `--torrent.download.rate=20mb`. <code>🔬 See [Downloade
Use `--datadir` to choose where to store data.

Use `--chain=gnosis` for [Gnosis Chain](https://www.gnosis.io/), `--chain=bor-mainnet` for Polygon Mainnet,
`--chain=mumbai` for Polygon Mumbai and `--chain=amoy` for Polygon Amoy.
and `--chain=amoy` for Polygon Amoy.
For Gnosis Chain you need a [Consensus Layer](#beacon-chain-consensus-layer) client alongside
Erigon (https://docs.gnosischain.com/node/manual/beacon).

Expand Down Expand Up @@ -363,7 +361,7 @@ Key features
============

<code>🔬 See more
detailed [overview of functionality and current limitations](https://erigontech.github.io/turbo_geth_release.html). It
detailed [overview of functionality and current limitations](https://ledgerwatch.github.io/turbo_geth_release.html). It
is being updated on recurring basis.</code>

### More Efficient State Storage
Expand All @@ -375,7 +373,7 @@ is being updated on recurring basis.</code>
**Preprocessing**. For some operations, Erigon uses temporary files to preprocess data before inserting it into the main
DB. That reduces write amplification and DB inserts are orders of magnitude quicker.

<code> 🔬 See our detailed ETL explanation [here](https://github.com/erigontech/erigon-lib/blob/main/etl/README.md).</code>
<code> 🔬 See our detailed ETL explanation [here](https://github.com/erigontech/erigon/blob/main/erigon-lib/etl/README.md).</code>

**Plain state**.

Expand Down Expand Up @@ -776,7 +774,7 @@ Golang 1.21

Almost all RPC methods are implemented - if something doesn't work - just drop it on our head.

Supported networks: all (except Mumbai).
Supported networks: all.

### E3 changes from E2:

Expand Down
7 changes: 4 additions & 3 deletions accounts/abi/argument.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package abi

import (
"encoding/json"
"errors"
"fmt"
"reflect"
"strings"
Expand Down Expand Up @@ -82,7 +83,7 @@ func (arguments Arguments) isTuple() bool {
func (arguments Arguments) Unpack(data []byte) ([]interface{}, error) {
if len(data) == 0 {
if len(arguments) != 0 {
return nil, fmt.Errorf("abi: attempting to unmarshall an empty string while arguments are expected")
return nil, errors.New("abi: attempting to unmarshall an empty string while arguments are expected")
}
// Nothing to unmarshal, return default variables
nonIndexedArgs := arguments.NonIndexed()
Expand All @@ -99,11 +100,11 @@ func (arguments Arguments) Unpack(data []byte) ([]interface{}, error) {
func (arguments Arguments) UnpackIntoMap(v map[string]interface{}, data []byte) error {
// Make sure map is not nil
if v == nil {
return fmt.Errorf("abi: cannot unpack into a nil map")
return errors.New("abi: cannot unpack into a nil map")
}
if len(data) == 0 {
if len(arguments) != 0 {
return fmt.Errorf("abi: attempting to unmarshall an empty string while arguments are expected")
return errors.New("abi: attempting to unmarshall an empty string while arguments are expected")
}
return nil // Nothing to unmarshal, return
}
Expand Down
8 changes: 7 additions & 1 deletion accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func NewSimulatedBackendWithConfig(t *testing.T, alloc types.GenesisAlloc, confi
engine := ethash.NewFaker()
checkStateRoot := true
m := mock.MockWithGenesisEngine(t, &genesis, engine, false, checkStateRoot)

backend := &SimulatedBackend{
m: m,
prependBlock: m.Genesis,
Expand Down Expand Up @@ -264,6 +265,7 @@ func (b *SimulatedBackend) TransactionReceipt(ctx context.Context, txHash libcom
return nil, err
}
defer tx.Rollback()

// Retrieve the context of the receipt based on the transaction hash
blockNumber, err := rawdb.ReadTxLookupEntry(tx, txHash)
if err != nil {
Expand All @@ -276,8 +278,12 @@ func (b *SimulatedBackend) TransactionReceipt(ctx context.Context, txHash libcom
if err != nil {
return nil, err
}

// Read all the receipts from the block and return the one with the matching hash
receipts := rawdb.ReadReceipts(tx, block, nil)
receipts, err := b.m.ReceiptsReader.GetReceipts(ctx, b.m.ChainConfig, tx, block)
if err != nil {
panic(err)
}
for _, receipt := range receipts {
if receipt.TxHash == txHash {
return receipt, nil
Expand Down
3 changes: 0 additions & 3 deletions accounts/abi/bind/backends/simulated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -863,9 +863,6 @@ func TestSimulatedBackend_TransactionReceipt(t *testing.T) {
}
sim.Commit()

if sim.m.HistoryV3 {
return
}
receipt, err := sim.TransactionReceipt(bgCtx, signedTx.Hash())
if err != nil {
t.Errorf("could not get transaction receipt: %v", err)
Expand Down
4 changes: 2 additions & 2 deletions accounts/abi/bind/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (c *BoundContract) transact(opts *TransactOpts, contract *libcommon.Address
if opts.Value != nil {
overflow := value.SetFromBig(opts.Value)
if overflow {
return nil, fmt.Errorf("opts.Value higher than 2^256-1")
return nil, errors.New("opts.Value higher than 2^256-1")
}
}
var nonce uint64
Expand All @@ -240,7 +240,7 @@ func (c *BoundContract) transact(opts *TransactOpts, contract *libcommon.Address
}
gasPrice, overflow := uint256.FromBig(gasPriceBig)
if overflow {
return nil, fmt.Errorf("gasPriceBig higher than 2^256-1")
return nil, errors.New("gasPriceBig higher than 2^256-1")
}
gasLimit := opts.GasLimit
if gasLimit == 0 {
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/reflect.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func mapArgNamesToStructFields(argNames []string, value reflect.Value) (map[stri
structFieldName := ToCamelCase(argName)

if structFieldName == "" {
return nil, fmt.Errorf("abi: purely underscored output cannot unpack to struct")
return nil, errors.New("abi: purely underscored output cannot unpack to struct")
}

// this abi has already been paired, skip it... unless there exists another, yet unassigned
Expand Down
4 changes: 2 additions & 2 deletions accounts/abi/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ var (
func NewType(t string, internalType string, components []ArgumentMarshaling) (typ Type, err error) {
// check that array brackets are equal if they exist
if strings.Count(t, "[") != strings.Count(t, "]") {
return Type{}, fmt.Errorf("invalid arg type in abi")
return Type{}, errors.New("invalid arg type in abi")
}
typ.stringKind = t

Expand Down Expand Up @@ -110,7 +110,7 @@ func NewType(t string, internalType string, components []ArgumentMarshaling) (ty
}
typ.stringKind = embeddedType.stringKind + sliced
} else {
return Type{}, fmt.Errorf("invalid formatting of array type")
return Type{}, errors.New("invalid formatting of array type")
}
return typ, err
}
Expand Down
Loading

0 comments on commit afa66f1

Please sign in to comment.