mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 14:16:44 +00:00
Merge pull request #1448 from maticnetwork/v2.0.0-candidate
v2.0.0 release
This commit is contained in:
commit
85d8b9cc37
98 changed files with 2355 additions and 2626 deletions
18
.github/workflows/ci.yml
vendored
18
.github/workflows/ci.yml
vendored
|
|
@ -29,7 +29,7 @@ jobs:
|
|||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.22.x
|
||||
go-version: 1.23.x
|
||||
|
||||
- name: Install dependencies on Linux
|
||||
if: runner.os == 'Linux'
|
||||
|
|
@ -61,7 +61,7 @@ jobs:
|
|||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.22.x
|
||||
go-version: 1.23.x
|
||||
|
||||
- name: Install dependencies on Linux
|
||||
if: runner.os == 'Linux'
|
||||
|
|
@ -89,7 +89,7 @@ jobs:
|
|||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.22.x
|
||||
go-version: 1.23.x
|
||||
|
||||
- name: Install dependencies on Linux
|
||||
if: runner.os == 'Linux'
|
||||
|
|
@ -140,7 +140,7 @@ jobs:
|
|||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.22.x
|
||||
go-version: 1.23.x
|
||||
|
||||
- name: Install dependencies on Linux
|
||||
if: runner.os == 'Linux'
|
||||
|
|
@ -196,7 +196,7 @@ jobs:
|
|||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.22.x
|
||||
go-version: 1.23.x
|
||||
|
||||
- name: Checkout matic-cli
|
||||
uses: actions/checkout@v4
|
||||
|
|
@ -236,15 +236,9 @@ jobs:
|
|||
- name: Launch devnet
|
||||
run: |
|
||||
cd matic-cli/devnet
|
||||
bash docker-ganache-start.sh
|
||||
bash docker-heimdall-start-all.sh
|
||||
bash docker-bor-setup.sh
|
||||
bash docker-bor-start-all.sh
|
||||
bash ../docker_devnet.sh
|
||||
cd -
|
||||
timeout 2m bash bor/integration-tests/bor_health.sh
|
||||
cd -
|
||||
bash ganache-deployment-bor.sh
|
||||
bash ganache-deployment-sync.sh
|
||||
|
||||
- name: Run smoke tests
|
||||
run: |
|
||||
|
|
|
|||
2
.github/workflows/codeql.yml
vendored
2
.github/workflows/codeql.yml
vendored
|
|
@ -25,7 +25,7 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v5
|
||||
|
|
|
|||
25
.github/workflows/govuln.yml
vendored
25
.github/workflows/govuln.yml
vendored
|
|
@ -1,25 +0,0 @@
|
|||
name: Govuln
|
||||
on: [ push, pull_request ]
|
||||
|
||||
jobs:
|
||||
govuln:
|
||||
name: Run govuln check and Publish
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Running govulncheck
|
||||
uses: Templum/govulncheck-action@v1.0.0
|
||||
continue-on-error: true
|
||||
env:
|
||||
DEBUG: "true"
|
||||
with:
|
||||
go-version: 1.22
|
||||
package: ./...
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
fail-on-vuln: true
|
||||
|
||||
- name: Upload govulncheck report
|
||||
uses: actions/upload-artifact@v4.4.0
|
||||
with:
|
||||
name: raw-report
|
||||
path: raw-report.json
|
||||
23
.github/workflows/govulncheck.yml
vendored
Normal file
23
.github/workflows/govulncheck.yml
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
name: Govuln
|
||||
on: [ push, pull_request ]
|
||||
|
||||
jobs:
|
||||
govulncheck:
|
||||
name: Run govulncheck
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: "1.23.6"
|
||||
check-latest: true
|
||||
- uses: actions/checkout@v4
|
||||
- uses: technote-space/get-diff-action@v6
|
||||
with:
|
||||
PATTERNS: |
|
||||
**/*.go
|
||||
go.mod
|
||||
go.sum
|
||||
Makefile
|
||||
- name: govulncheck
|
||||
run: make vulncheck
|
||||
if: "env.GIT_DIFF != ''"
|
||||
4
.github/workflows/packager_deb.yml
vendored
4
.github/workflows/packager_deb.yml
vendored
|
|
@ -24,7 +24,7 @@ jobs:
|
|||
- name: Set up Go
|
||||
uses: actions/setup-go@master
|
||||
with:
|
||||
go-version: 1.22.1
|
||||
go-version: 1.23.6
|
||||
# Variables
|
||||
- name: Adding TAG to ENV
|
||||
run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV
|
||||
|
|
@ -126,4 +126,4 @@ jobs:
|
|||
prerelease: true
|
||||
files: |
|
||||
packaging/deb/bor**.deb
|
||||
packaging/deb/bor**.deb.checksum
|
||||
packaging/deb/bor**.deb.checksum
|
||||
|
|
|
|||
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
|
|
@ -14,14 +14,14 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@master
|
||||
with:
|
||||
go-version: 1.22.x
|
||||
go-version: 1.23.x
|
||||
|
||||
- name: Prepare
|
||||
id: prepare
|
||||
|
|
|
|||
325
.github/workflows/rpm_amoy_profile_packager.yml
vendored
325
.github/workflows/rpm_amoy_profile_packager.yml
vendored
|
|
@ -1,325 +0,0 @@
|
|||
name: rpm_amoy_profile
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
paths:
|
||||
- '**'
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
- 'v*.*.*-*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Adding TAG to ENV
|
||||
run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV
|
||||
|
||||
- name: Adding a TAG1 to the env
|
||||
run: echo "GIT_TAG1=`echo $(git describe --tags --abbrev=0)`" | sed 's/-/./g' >> $GITHUB_ENV
|
||||
|
||||
- name: Installing some dependencies
|
||||
run: sudo apt-get update && sudo apt-get install -y rpm
|
||||
|
||||
- name: Setup rpm package directories
|
||||
run: |
|
||||
mkdir -p packaging/rpm/SPECS
|
||||
mkdir -p packaging/rpm/BUILD
|
||||
mkdir -p packaging/rpm/RPMS
|
||||
mkdir -p packaging/rpm/SRPMS
|
||||
|
||||
- name: Start tasks needed for Amoy Sentry node
|
||||
run: echo "#########################################################################"
|
||||
|
||||
- name: Setting up Amoy Sentry Node Spec files
|
||||
run: |
|
||||
touch packaging/rpm/bor-amoy-sentry.spec
|
||||
echo "Name: bor-amoy-sentry-config" >> packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
echo "Summary: bor amoy sentry config rpm package" >> packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
|
||||
echo "%description" >> packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
echo "Bor Amoy Sentry rpm package" >> packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
|
||||
echo "" >> packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
echo "%pre" >> packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
echo "" >> packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
echo "%install" >> packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/testnet-amoy/sentry/sentry/bor/config.toml %{buildroot}/var/lib/bor/" >> packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/systemd/bor.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
|
||||
echo "%files" >> packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
echo "%post" >> packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
|
||||
- name: Build Amoy Sentry Node profile RPM
|
||||
run: |
|
||||
rpmbuild --define "_topdir /home/runner/work/bor/bor/packaging/rpm_build" \
|
||||
--define "_builddir %{_topdir}/BUILD" \
|
||||
--define "_rpmdir %{_topdir}/RPMS" \
|
||||
--define "_srcrpmdir %{_topdir}/SRPMS" \
|
||||
--define "__spec_install_post /bin/true" \
|
||||
-bb packaging/rpm/SPECS/bor-amoy-sentry.spec
|
||||
|
||||
- name: Start tasks needed for Amoy Sentry PBSS node
|
||||
run: echo "#########################################################################"
|
||||
|
||||
- name: Setting up Amoy Sentry PBSS Node Spec files
|
||||
run: |
|
||||
touch packaging/rpm/bor-pbss-amoy-sentry.spec
|
||||
echo "Name: bor-pbss-amoy-sentry-config" >> packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
echo "Summary: bor amoy sentry config rpm package" >> packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
|
||||
echo "%description" >> packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
echo "Bor Amoy Sentry rpm package" >> packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
|
||||
echo "" >> packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
echo "%pre" >> packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
echo "" >> packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
echo "%install" >> packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/testnet-amoy/sentry/sentry/bor/pbss_config.toml %{buildroot}/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/systemd/bor.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
|
||||
echo "%files" >> packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
echo "%post" >> packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
|
||||
- name: Build Amoy Sentry PBSS Node profile RPM
|
||||
run: |
|
||||
rpmbuild --define "_topdir /home/runner/work/bor/bor/packaging/rpm_build" \
|
||||
--define "_builddir %{_topdir}/BUILD" \
|
||||
--define "_rpmdir %{_topdir}/RPMS" \
|
||||
--define "_srcrpmdir %{_topdir}/SRPMS" \
|
||||
--define "__spec_install_post /bin/true" \
|
||||
-bb packaging/rpm/SPECS/bor-pbss-amoy-sentry.spec
|
||||
|
||||
- name: Setting up Amoy Validator Node node
|
||||
run: echo "#########################################################################"
|
||||
|
||||
- name: Setting up Amoy Validator Node Spec files
|
||||
run: |
|
||||
touch packaging/rpm/bor-amoy-validator.spec
|
||||
echo "Name: bor-amoy-validator-config" >> packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
echo "Summary: bor amoy validator config rpm package" >> packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
|
||||
echo "%description" >> packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
echo "Bor Amoy Validator rpm package" >> packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
|
||||
echo "" >> packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
echo "%pre" >> packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
echo "" >> packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
echo "%install" >> packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/testnet-amoy/sentry/validator/bor/config.toml %{buildroot}/var/lib/bor/" >> packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/systemd/bor.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
|
||||
echo "%files" >> packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
echo "%post" >> packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
|
||||
|
||||
- name: Build Amoy Validator Node profile RPM
|
||||
run: |
|
||||
rpmbuild --define "_topdir /home/runner/work/bor/bor/packaging/rpm_build" \
|
||||
--define "_builddir %{_topdir}/BUILD" \
|
||||
--define "_rpmdir %{_topdir}/RPMS" \
|
||||
--define "_srcrpmdir %{_topdir}/SRPMS" \
|
||||
--define "__spec_install_post /bin/true" \
|
||||
-bb packaging/rpm/SPECS/bor-amoy-validator.spec
|
||||
|
||||
- name: Setting up Amoy Validator PBSS Node node
|
||||
run: echo "#########################################################################"
|
||||
|
||||
- name: Setting up Amoy Validator PBSS Node Spec files
|
||||
run: |
|
||||
touch packaging/rpm/bor-pbss-amoy-validator.spec
|
||||
echo "Name: bor-pbss-amoy-validator-config" >> packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
echo "Summary: bor amoy validator config rpm package" >> packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
|
||||
echo "%description" >> packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
echo "Bor Amoy Validator rpm package" >> packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
|
||||
echo "" >> packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
echo "%pre" >> packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
echo "" >> packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
echo "%install" >> packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/testnet-amoy/sentry/validator/bor/pbss_config.toml %{buildroot}/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/systemd/bor.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
|
||||
echo "%files" >> packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
echo "%post" >> packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
|
||||
|
||||
- name: Build Amoy Validator PBSS Node profile RPM
|
||||
run: |
|
||||
rpmbuild --define "_topdir /home/runner/work/bor/bor/packaging/rpm_build" \
|
||||
--define "_builddir %{_topdir}/BUILD" \
|
||||
--define "_rpmdir %{_topdir}/RPMS" \
|
||||
--define "_srcrpmdir %{_topdir}/SRPMS" \
|
||||
--define "__spec_install_post /bin/true" \
|
||||
-bb packaging/rpm/SPECS/bor-pbss-amoy-validator.spec
|
||||
|
||||
|
||||
- name: Setting up Amoy Boot node
|
||||
run: echo "#########################################################################"
|
||||
|
||||
- name: Setting up Amoy Boot Node Spec files
|
||||
run: |
|
||||
touch packaging/rpm/bor-amoy-bootnode.spec
|
||||
echo "Name: bor-amoy-bootnode-config" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
echo "Summary: bor amoy bootnode config rpm package" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
|
||||
echo "%description" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
echo "Bor Amoy Bootnode rpm package" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
|
||||
echo "" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
echo "%pre" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
echo "" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
echo "%install" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/testnet-amoy/sentry/sentry/bor/config.toml %{buildroot}/var/lib/bor/" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/systemd/bor_bootnode.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
|
||||
echo "%files" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
echo "%post" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
|
||||
- name: Build Amoy Boot Node profile RPM
|
||||
run: |
|
||||
rpmbuild --define "_topdir /home/runner/work/bor/bor/packaging/rpm_build" \
|
||||
--define "_builddir %{_topdir}/BUILD" \
|
||||
--define "_rpmdir %{_topdir}/RPMS" \
|
||||
--define "_srcrpmdir %{_topdir}/SRPMS" \
|
||||
--define "__spec_install_post /bin/true" \
|
||||
-bb packaging/rpm/SPECS/bor-amoy-bootnode.spec
|
||||
|
||||
- name: Setting up Amoy Archive node
|
||||
run: echo "#########################################################################"
|
||||
|
||||
- name: Setting up Amoy Archive Node spec file
|
||||
run: |
|
||||
touch packaging/rpm/bor-amoy-archive.spec
|
||||
echo "Name: bor-amoy-archive-config" >> packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
echo "Summary: bor amoy archive config rpm package" >> packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
|
||||
echo "%description" >> packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
echo "Bor Amoy Archive rpm package" >> packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
|
||||
echo "" >> packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
echo "%pre" >> packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
echo "" >> packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
echo "%install" >> packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/testnet-amoy/archive/config.toml %{buildroot}/var/lib/bor/" >> packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/systemd/bor.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
|
||||
echo "%files" >> packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
echo "%post" >> packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
|
||||
- name: Build Amoy Archive Node profile RPM
|
||||
run: |
|
||||
rpmbuild --define "_topdir /home/runner/work/bor/bor/packaging/rpm_build" \
|
||||
--define "_builddir %{_topdir}/BUILD" \
|
||||
--define "_rpmdir %{_topdir}/RPMS" \
|
||||
--define "_srcrpmdir %{_topdir}/SRPMS" \
|
||||
--define "__spec_install_post /bin/true" \
|
||||
-bb packaging/rpm/SPECS/bor-amoy-archive.spec
|
||||
|
||||
- name: renaming file for rpm release appendage archive amoy
|
||||
run: mv /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-amoy-archive-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-amoy-archive-config-${{ env.GIT_TAG1 }}.noarch.rpm
|
||||
- name: renaming file for rpm release appendage bootnode amoy
|
||||
run: mv /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-amoy-bootnode-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-amoy-bootnode-config-${{ env.GIT_TAG1 }}.noarch.rpm
|
||||
- name: renaming file for rpm release appendage sentry amoy
|
||||
run: mv /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-amoy-sentry-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-amoy-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm
|
||||
- name: renaming file for rpm release appendage sentry pbss amoy
|
||||
run: mv /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-pbss-amoy-sentry-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-pbss-amoy-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm
|
||||
- name: renaming file for rpm release appendage validator amoy
|
||||
run: mv /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-amoy-validator-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-amoy-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm
|
||||
- name: renaming file for rpm release appendage validator pbss amoy
|
||||
run: mv /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-pbss-amoy-validator-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-pbss-amoy-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm
|
||||
|
||||
- name: adding shasum for the rpm build amoy archive
|
||||
run: cd /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-amoy-archive-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-amoy-archive-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum
|
||||
- name: adding shasum for the rpm build amoy bootnode
|
||||
run: cd /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-amoy-bootnode-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-amoy-bootnode-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum
|
||||
- name: adding shasum for the rpm build amoy sentry
|
||||
run: cd /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-amoy-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-amoy-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum
|
||||
- name: adding shasum for the rpm build amoy sentry pbss
|
||||
run: cd /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-pbss-amoy-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-pbss-amoy-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum
|
||||
- name: adding shasum for the rpm build amoy validator
|
||||
run: cd /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-amoy-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-amoy-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum
|
||||
- name: adding shasum for the rpm build amoy validator pbss
|
||||
run: cd /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-pbss-amoy-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-pbss-amoy-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum
|
||||
|
||||
|
||||
- name: Release bor Packages
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ env.GIT_TAG }}
|
||||
prerelease: true
|
||||
files: |
|
||||
packaging/rpm_build/RPMS/noarch/bor-amoy-**.rpm
|
||||
packaging/rpm_build/RPMS/noarch/bor-amoy-**.rpm.checksum
|
||||
packaging/rpm_build/RPMS/noarch/bor-pbss-amoy-**.rpm
|
||||
packaging/rpm_build/RPMS/noarch/bor-pbss-amoy-**.rpm.checksum
|
||||
95
.github/workflows/rpm_arm_packager.yml
vendored
95
.github/workflows/rpm_arm_packager.yml
vendored
|
|
@ -1,95 +0,0 @@
|
|||
name: package_arm_rpm
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
paths:
|
||||
- '**'
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
- 'v*.*.*-*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: write
|
||||
runs-on:
|
||||
labels: arm-runner-2204
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@master
|
||||
with:
|
||||
go-version: 1.22.1
|
||||
- name: Adding TAG to ENV
|
||||
run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV
|
||||
|
||||
- name: Adding a TAG1 to the env
|
||||
run: echo "GIT_TAG1=`echo $(git describe --tags --abbrev=0)`" | sed 's/-/./g' >> $GITHUB_ENV
|
||||
|
||||
- name: Cleaning repo
|
||||
run: make clean
|
||||
- name: Building for arm64
|
||||
run: make bor
|
||||
|
||||
- name: Installing some dependencies
|
||||
run: sudo apt-get update && sudo apt-get install -y rpm
|
||||
|
||||
- name: Setup rpm package for binary
|
||||
run: |
|
||||
mkdir -p packaging/rpm/SPECS
|
||||
mkdir -p packaging/rpm/BUILD
|
||||
mkdir -p packaging/rpm/RPMS
|
||||
mkdir -p packaging/rpm/SRPMS
|
||||
|
||||
touch packaging/rpm/bor.spec
|
||||
echo "Name: bor" >> packaging/rpm/SPECS/bor.spec
|
||||
echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor.spec
|
||||
echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor.spec
|
||||
echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor.spec
|
||||
echo "BuildArch: aarch64" >> packaging/rpm/SPECS/bor.spec
|
||||
echo "Summary: bor rpm package" >> packaging/rpm/SPECS/bor.spec
|
||||
|
||||
echo "%description" >> packaging/rpm/SPECS/bor.spec
|
||||
echo "Bor rpm package" >> packaging/rpm/SPECS/bor.spec
|
||||
|
||||
echo "%pre" >> packaging/rpm/SPECS/bor.spec
|
||||
echo "getent group bor >/dev/null || groupadd -r bor" >> packaging/rpm/SPECS/bor.spec
|
||||
echo "getent passwd bor >/dev/null || useradd -s /bin/false -d /var/lib/bor -r bor -g bor" >> packaging/rpm/SPECS/bor.spec
|
||||
|
||||
echo "%install" >> packaging/rpm/SPECS/bor.spec
|
||||
echo "mkdir -p %{buildroot}/usr/bin" >> packaging/rpm/SPECS/bor.spec
|
||||
echo "cp /home/runner/work/bor/bor/build/bin/bor %{buildroot}/usr/bin/" >> packaging/rpm/SPECS/bor.spec
|
||||
|
||||
echo "%files" >> packaging/rpm/SPECS/bor.spec
|
||||
echo "/usr/bin/bor" >> packaging/rpm/SPECS/bor.spec
|
||||
|
||||
|
||||
- name: construct rpm package
|
||||
run: |
|
||||
rpmbuild --define "_topdir /home/runner/work/bor/bor/packaging/rpm_build" \
|
||||
--define "_builddir %{_topdir}/BUILD" \
|
||||
--define "_rpmdir %{_topdir}/RPMS" \
|
||||
--define "_srcrpmdir %{_topdir}/SRPMS" \
|
||||
--define "__spec_install_post /bin/true" \
|
||||
-bb packaging/rpm/SPECS/bor.spec
|
||||
|
||||
- name: rename file for post rpm build and for checksum
|
||||
run: mv /home/runner/work/bor/bor/packaging/rpm_build/RPMS/aarch64/bor-${{ env.GIT_TAG1 }}-1.aarch64.rpm /home/runner/work/bor/bor/packaging/rpm_build/RPMS/aarch64/bor-${{ env.GIT_TAG1 }}.aarch64.rpm
|
||||
|
||||
- name: checksum for the rpm package
|
||||
run: sha256sum /home/runner/work/bor/bor/packaging/rpm_build/RPMS/aarch64/bor-${{ env.GIT_TAG1 }}.aarch64.rpm > /home/runner/work/bor/bor/packaging/rpm_build/RPMS/aarch64/bor-${{ env.GIT_TAG1 }}.aarch64.rpm.checksum
|
||||
|
||||
- name: Release bor Packages
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ env.GIT_TAG }}
|
||||
prerelease: true
|
||||
files: |
|
||||
packaging/rpm_build/RPMS/aarch64/bor-**.rpm
|
||||
packaging/rpm_build/RPMS/aarch64/bor-**.rpm.checksum
|
||||
323
.github/workflows/rpm_mainnet_profile_packager.yml
vendored
323
.github/workflows/rpm_mainnet_profile_packager.yml
vendored
|
|
@ -1,323 +0,0 @@
|
|||
name: rpm_mainnet_profile
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
paths:
|
||||
- '**'
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
- 'v*.*.*-*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Adding TAG to ENV
|
||||
run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV
|
||||
|
||||
- name: Adding a TAG1 to the env
|
||||
run: echo "GIT_TAG1=`echo $(git describe --tags --abbrev=0)`" | sed 's/-/./g' >> $GITHUB_ENV
|
||||
|
||||
- name: Installing some dependencies
|
||||
run: sudo apt-get update && sudo apt-get install -y rpm
|
||||
|
||||
- name: Setup rpm package directories
|
||||
run: |
|
||||
mkdir -p packaging/rpm/SPECS
|
||||
mkdir -p packaging/rpm/BUILD
|
||||
mkdir -p packaging/rpm/RPMS
|
||||
mkdir -p packaging/rpm/SRPMS
|
||||
|
||||
- name: Start tasks needed for Mainnet Sentry node
|
||||
run: echo "#########################################################################"
|
||||
|
||||
- name: Setting up Mainnet Sentry Node Spec files
|
||||
run: |
|
||||
touch packaging/rpm/bor-mainnet-sentry.spec
|
||||
echo "Name: bor-mainnet-sentry-config" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
echo "Summary: bor mainnet sentry config rpm package" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
|
||||
echo "%description" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
echo "Bor Mumbai Sentry rpm package" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
|
||||
echo "" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
echo "%pre" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
echo "" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
echo "%install" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml %{buildroot}/var/lib/bor/" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/systemd/bor.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
|
||||
echo "%files" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
echo "%post" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
|
||||
- name: Build Mainnet Sentry Node profile RPM
|
||||
run: |
|
||||
rpmbuild --define "_topdir /home/runner/work/bor/bor/packaging/rpm_build" \
|
||||
--define "_builddir %{_topdir}/BUILD" \
|
||||
--define "_rpmdir %{_topdir}/RPMS" \
|
||||
--define "_srcrpmdir %{_topdir}/SRPMS" \
|
||||
--define "__spec_install_post /bin/true" \
|
||||
-bb packaging/rpm/SPECS/bor-mainnet-sentry.spec
|
||||
|
||||
- name: Start tasks needed for Mainnet Sentry PBSS node
|
||||
run: echo "#########################################################################"
|
||||
|
||||
- name: Setting up Mainnet Sentry PBSS Node Spec files
|
||||
run: |
|
||||
touch packaging/rpm/bor-pbss-mainnet-sentry.spec
|
||||
echo "Name: bor-pbss-mainnet-sentry-config" >> packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
echo "Summary: bor mainnet sentry config rpm package" >> packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
|
||||
echo "%description" >> packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
echo "Bor Mumbai Sentry rpm package" >> packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
|
||||
echo "" >> packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
echo "%pre" >> packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
echo "" >> packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
echo "%install" >> packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/mainnet-v1/sentry/sentry/bor/pbss_config.toml %{buildroot}/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/systemd/bor.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
|
||||
echo "%files" >> packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
echo "%post" >> packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
|
||||
- name: Build Mainnet Sentry PBSS Node profile RPM
|
||||
run: |
|
||||
rpmbuild --define "_topdir /home/runner/work/bor/bor/packaging/rpm_build" \
|
||||
--define "_builddir %{_topdir}/BUILD" \
|
||||
--define "_rpmdir %{_topdir}/RPMS" \
|
||||
--define "_srcrpmdir %{_topdir}/SRPMS" \
|
||||
--define "__spec_install_post /bin/true" \
|
||||
-bb packaging/rpm/SPECS/bor-pbss-mainnet-sentry.spec
|
||||
|
||||
- name: Setting up Mainnet Validator Node node
|
||||
run: echo "#########################################################################"
|
||||
|
||||
- name: Setting up Mainnet Validator Node Spec files
|
||||
run: |
|
||||
touch packaging/rpm/bor-mainnet-validator.spec
|
||||
echo "Name: bor-mainnet-validator-config" >> packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
echo "Summary: bor mainnet validator config rpm package" >> packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
|
||||
echo "%description" >> packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
echo "Bor Mainnet Validator rpm package" >> packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
|
||||
echo "" >> packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
echo "%pre" >> packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
echo "" >> packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
echo "%install" >> packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/mainnet-v1/sentry/validator/bor/config.toml %{buildroot}/var/lib/bor/" >> packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/systemd/bor.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
|
||||
echo "%files" >> packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
echo "%post" >> packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
|
||||
|
||||
- name: Build Mainnet Validator Node profile RPM
|
||||
run: |
|
||||
rpmbuild --define "_topdir /home/runner/work/bor/bor/packaging/rpm_build" \
|
||||
--define "_builddir %{_topdir}/BUILD" \
|
||||
--define "_rpmdir %{_topdir}/RPMS" \
|
||||
--define "_srcrpmdir %{_topdir}/SRPMS" \
|
||||
--define "__spec_install_post /bin/true" \
|
||||
-bb packaging/rpm/SPECS/bor-mainnet-validator.spec
|
||||
|
||||
- name: Setting up Mainnet Validator PBSS Node node
|
||||
run: echo "#########################################################################"
|
||||
|
||||
- name: Setting up Mainnet Validator Node Spec files
|
||||
run: |
|
||||
touch packaging/rpm/bor-pbss-mainnet-validator.spec
|
||||
echo "Name: bor-pbss-mainnet-validator-config" >> packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
echo "Summary: bor mainnet validator config rpm package" >> packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
|
||||
echo "%description" >> packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
echo "Bor Mainnet Validator rpm package" >> packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
|
||||
echo "" >> packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
echo "%pre" >> packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
echo "" >> packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
echo "%install" >> packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/mainnet-v1/sentry/validator/bor/pbss_config.toml %{buildroot}/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/systemd/bor.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
|
||||
echo "%files" >> packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
echo "%post" >> packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
|
||||
|
||||
- name: Build Mainnet Validator PBSS Node profile RPM
|
||||
run: |
|
||||
rpmbuild --define "_topdir /home/runner/work/bor/bor/packaging/rpm_build" \
|
||||
--define "_builddir %{_topdir}/BUILD" \
|
||||
--define "_rpmdir %{_topdir}/RPMS" \
|
||||
--define "_srcrpmdir %{_topdir}/SRPMS" \
|
||||
--define "__spec_install_post /bin/true" \
|
||||
-bb packaging/rpm/SPECS/bor-pbss-mainnet-validator.spec
|
||||
|
||||
- name: Setting up Mainnet Boot node
|
||||
run: echo "#########################################################################"
|
||||
|
||||
- name: Setting up Mainnet Boot Node Spec files
|
||||
run: |
|
||||
touch packaging/rpm/bor-mainnet-bootnode.spec
|
||||
echo "Name: bor-mainnet-bootnode-config" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
echo "Summary: bor mainnet bootnode config rpm package" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
|
||||
echo "%description" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
echo "Bor Mainnet Bootnode rpm package" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
|
||||
echo "" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
echo "%pre" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
echo "" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
echo "%install" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml %{buildroot}/var/lib/bor/" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/systemd/bor_bootnode.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
|
||||
echo "%files" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
echo "%post" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
|
||||
- name: Build Mainnet Boot Node profile RPM
|
||||
run: |
|
||||
rpmbuild --define "_topdir /home/runner/work/bor/bor/packaging/rpm_build" \
|
||||
--define "_builddir %{_topdir}/BUILD" \
|
||||
--define "_rpmdir %{_topdir}/RPMS" \
|
||||
--define "_srcrpmdir %{_topdir}/SRPMS" \
|
||||
--define "__spec_install_post /bin/true" \
|
||||
-bb packaging/rpm/SPECS/bor-mainnet-bootnode.spec
|
||||
|
||||
- name: Setting up Mainnet Archive node
|
||||
run: echo "#########################################################################"
|
||||
|
||||
- name: Setting up Mainnet Archive Node spec file
|
||||
run: |
|
||||
touch packaging/rpm/bor-mainnet-archive.spec
|
||||
echo "Name: bor-mainnet-archive-config" >> packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
echo "Summary: bor mainnet archive config rpm package" >> packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
|
||||
echo "%description" >> packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
echo "Bor Mainnet Archive rpm package" >> packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
|
||||
echo "" >> packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
echo "%pre" >> packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
echo "" >> packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
echo "%install" >> packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/mainnet-v1/archive/config.toml %{buildroot}/var/lib/bor/" >> packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
echo "cp /home/runner/work/bor/bor/packaging/templates/systemd/bor.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
|
||||
echo "%files" >> packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
echo "%post" >> packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
|
||||
- name: Build Mainnet Archive Node profile RPM
|
||||
run: |
|
||||
rpmbuild --define "_topdir /home/runner/work/bor/bor/packaging/rpm_build" \
|
||||
--define "_builddir %{_topdir}/BUILD" \
|
||||
--define "_rpmdir %{_topdir}/RPMS" \
|
||||
--define "_srcrpmdir %{_topdir}/SRPMS" \
|
||||
--define "__spec_install_post /bin/true" \
|
||||
-bb packaging/rpm/SPECS/bor-mainnet-archive.spec
|
||||
|
||||
- name: renaming file for rpm release appendage archive mainnet
|
||||
run: mv /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-mainnet-archive-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-mainnet-archive-config-${{ env.GIT_TAG1 }}.noarch.rpm
|
||||
- name: renaming file for rpm release appendage bootnode mainnet
|
||||
run: mv /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-mainnet-bootnode-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-mainnet-bootnode-config-${{ env.GIT_TAG1 }}.noarch.rpm
|
||||
- name: renaming file for rpm release appendage sentry mainnet
|
||||
run: mv /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-mainnet-sentry-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-mainnet-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm
|
||||
- name: renaming file for rpm release appendage sentry pbss mainnet
|
||||
run: mv /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-pbss-mainnet-sentry-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-pbss-mainnet-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm
|
||||
- name: renaming file for rpm release appendage validator mainnet
|
||||
run: mv /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-mainnet-validator-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-mainnet-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm
|
||||
- name: renaming file for rpm release appendage validator pbss mainnet
|
||||
run: mv /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-pbss-mainnet-validator-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-pbss-mainnet-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm
|
||||
|
||||
- name: adding shasum for the rpm build mainnet archive
|
||||
run: cd /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-mainnet-archive-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-mainnet-archive-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum
|
||||
- name: adding shasum for the rpm build mainnet bootnode
|
||||
run: cd /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-mainnet-bootnode-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-mainnet-bootnode-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum
|
||||
- name: adding shasum for the rpm build mainnet sentry
|
||||
run: cd /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-mainnet-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-mainnet-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum
|
||||
- name: adding shasum for the rpm build mainnet sentry pbss
|
||||
run: cd /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-pbss-mainnet-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-pbss-mainnet-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum
|
||||
- name: adding shasum for the rpm build mainnet validator
|
||||
run: cd /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-mainnet-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-mainnet-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum
|
||||
- name: adding shasum for the rpm build mainnet pbss validator
|
||||
run: cd /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-pbss-mainnet-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor/bor/packaging/rpm_build/RPMS/noarch/bor-pbss-mainnet-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum
|
||||
|
||||
- name: Release bor Packages
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ env.GIT_TAG }}
|
||||
prerelease: true
|
||||
files: |
|
||||
packaging/rpm_build/RPMS/noarch/bor-mainnet-**.rpm
|
||||
packaging/rpm_build/RPMS/noarch/bor-mainnet-**.rpm.checksum
|
||||
packaging/rpm_build/RPMS/noarch/bor-pbss-mainnet-**.rpm
|
||||
packaging/rpm_build/RPMS/noarch/bor-pbss-mainnet-**.rpm.checksum
|
||||
94
.github/workflows/rpm_packager.yml
vendored
94
.github/workflows/rpm_packager.yml
vendored
|
|
@ -1,94 +0,0 @@
|
|||
name: package_x86_rpm
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
paths:
|
||||
- '**'
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
- 'v*.*.*-*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@master
|
||||
with:
|
||||
go-version: 1.22.1
|
||||
- name: Adding TAG to ENV
|
||||
run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV
|
||||
|
||||
- name: Adding a TAG.1 to the env
|
||||
run: echo "GIT_TAG1=`echo $(git describe --tags --abbrev=0)`" | sed 's/-/./g' >> $GITHUB_ENV
|
||||
|
||||
- name: Cleaning repo
|
||||
run: make clean
|
||||
- name: Building for amd64
|
||||
run: make bor
|
||||
|
||||
- name: Installing some dependencies
|
||||
run: sudo apt-get update && sudo apt-get install -y rpm
|
||||
|
||||
- name: Setup rpm package for binary
|
||||
run: |
|
||||
mkdir -p packaging/rpm/SPECS
|
||||
mkdir -p packaging/rpm/BUILD
|
||||
mkdir -p packaging/rpm/RPMS
|
||||
mkdir -p packaging/rpm/SRPMS
|
||||
|
||||
touch packaging/rpm/bor.spec
|
||||
echo "Name: bor" >> packaging/rpm/SPECS/bor.spec
|
||||
echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor.spec
|
||||
echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor.spec
|
||||
echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor.spec
|
||||
echo "BuildArch: x86_64" >> packaging/rpm/SPECS/bor.spec
|
||||
echo "Summary: bor rpm package" >> packaging/rpm/SPECS/bor.spec
|
||||
|
||||
echo "%description" >> packaging/rpm/SPECS/bor.spec
|
||||
echo "Bor rpm package" >> packaging/rpm/SPECS/bor.spec
|
||||
|
||||
echo "%pre" >> packaging/rpm/SPECS/bor.spec
|
||||
echo "getent group bor >/dev/null || groupadd -r bor" >> packaging/rpm/SPECS/bor.spec
|
||||
echo "getent passwd bor >/dev/null || useradd -s /bin/false -d /var/lib/bor -r bor -g bor" >> packaging/rpm/SPECS/bor.spec
|
||||
|
||||
echo "%install" >> packaging/rpm/SPECS/bor.spec
|
||||
echo "mkdir -p %{buildroot}/usr/bin" >> packaging/rpm/SPECS/bor.spec
|
||||
echo "cp /home/runner/work/bor/bor/build/bin/bor %{buildroot}/usr/bin/" >> packaging/rpm/SPECS/bor.spec
|
||||
|
||||
echo "%files" >> packaging/rpm/SPECS/bor.spec
|
||||
echo "/usr/bin/bor" >> packaging/rpm/SPECS/bor.spec
|
||||
|
||||
|
||||
- name: construct rpm package
|
||||
run: |
|
||||
rpmbuild --define "_topdir /home/runner/work/bor/bor/packaging/rpm_build" \
|
||||
--define "_builddir %{_topdir}/BUILD" \
|
||||
--define "_rpmdir %{_topdir}/RPMS" \
|
||||
--define "_srcrpmdir %{_topdir}/SRPMS" \
|
||||
--define "__spec_install_post /bin/true" \
|
||||
-bb packaging/rpm/SPECS/bor.spec
|
||||
|
||||
- name: rename file for post rpm build and for checksum
|
||||
run: mv /home/runner/work/bor/bor/packaging/rpm_build/RPMS/x86_64/bor-${{ env.GIT_TAG1 }}-1.x86_64.rpm /home/runner/work/bor/bor/packaging/rpm_build/RPMS/x86_64/bor-${{ env.GIT_TAG1 }}.x86_64.rpm
|
||||
|
||||
- name: checksum for the rpm package
|
||||
run: sha256sum /home/runner/work/bor/bor/packaging/rpm_build/RPMS/x86_64/bor-${{ env.GIT_TAG1 }}.x86_64.rpm > /home/runner/work/bor/bor/packaging/rpm_build/RPMS/x86_64/bor-${{ env.GIT_TAG1 }}.x86_64.rpm.checksum
|
||||
|
||||
- name: Release bor Packages
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ env.GIT_TAG }}
|
||||
prerelease: true
|
||||
files: |
|
||||
packaging/rpm_build/RPMS/x86_64/bor-**.rpm
|
||||
packaging/rpm_build/RPMS/x86_64/bor-**.rpm.checksum
|
||||
2
.github/workflows/stale.yml
vendored
2
.github/workflows/stale.yml
vendored
|
|
@ -18,7 +18,7 @@ jobs:
|
|||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- uses: actions/stale@v5
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: 'This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.'
|
||||
|
|
|
|||
8
Makefile
8
Makefile
|
|
@ -84,7 +84,13 @@ lint:
|
|||
|
||||
lintci-deps:
|
||||
rm -f ./build/bin/golangci-lint
|
||||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./build/bin v1.57.2
|
||||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./build/bin v1.63.4
|
||||
|
||||
.PHONY: vulncheck
|
||||
|
||||
vulncheck:
|
||||
@go run golang.org/x/vuln/cmd/govulncheck@latest ./...
|
||||
|
||||
|
||||
goimports:
|
||||
goimports -local "$(PACKAGE)" -w .
|
||||
|
|
|
|||
|
|
@ -1014,7 +1014,7 @@ func TestOOMMaliciousInput(t *testing.T) {
|
|||
|
||||
encb, err := hex.DecodeString(test.enc)
|
||||
if err != nil {
|
||||
t.Fatalf("invalid hex: %s" + test.enc)
|
||||
t.Fatalf("invalid hex: %s", test.enc)
|
||||
}
|
||||
|
||||
_, err = abi.Methods["method"].Outputs.UnpackValues(encb)
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ func BlockFromJSON(forkName string, data []byte) (*BeaconBlock, error) {
|
|||
case "capella":
|
||||
obj = new(capella.BeaconBlock)
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported fork: " + forkName)
|
||||
return nil, fmt.Errorf("unsupported fork: %s", forkName)
|
||||
}
|
||||
if err := json.Unmarshal(data, obj); err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ func ExecutionHeaderFromJSON(forkName string, data []byte) (*ExecutionHeader, er
|
|||
case "deneb":
|
||||
obj = new(deneb.ExecutionPayloadHeader)
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported fork: " + forkName)
|
||||
return nil, fmt.Errorf("unsupported fork: %s", forkName)
|
||||
}
|
||||
if err := json.Unmarshal(data, obj); err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
# NOTE: Uncomment and configure the following 8 fields in case you run a validator:
|
||||
# `mine`, `etherbase`, `nodiscover`, `maxpeers`, `keystore`, `allow-insecure-unlock`, `password`, `unlock`
|
||||
|
||||
chain = "mainnet"
|
||||
# chain = "mumbai", "amoy"
|
||||
chain = "mainnet" # Set it to `amoy` for testnet
|
||||
# identity = "Annon-Identity"
|
||||
# verbosity = 3
|
||||
# vmdebug = false
|
||||
datadir = "/var/lib/bor/data"
|
||||
# ancient = ""
|
||||
# "db.engine" = "leveldb"
|
||||
# "db.engine" = "pebble"
|
||||
# "state.scheme" = "path"
|
||||
# keystore = "/var/lib/bor/keystore"
|
||||
# "rpc.batchlimit" = 100
|
||||
# "rpc.returndatalimit" = 100000
|
||||
|
|
@ -41,13 +41,16 @@ syncmode = "full"
|
|||
# v4disc = true
|
||||
# v5disc = false
|
||||
bootnodes = ["enode://b8f1cc9c5d4403703fbf377116469667d2b1823c0daf16b7250aa576bacf399e42c3930ccfcb02c5df6879565a2b8931335565f0e8d3f8e72385ecf4a4bf160a@3.36.224.80:30303", "enode://8729e0c825f3d9cad382555f3e46dcff21af323e89025a0e6312df541f4a9e73abfa562d64906f5e59c51fe6f0501b3e61b07979606c56329c020ed739910759@54.194.245.5:30303"]
|
||||
# Uncomment below `bootnodes` field for Mumbai bootnode
|
||||
# bootnodes = ["enode://bdcd4786a616a853b8a041f53496d853c68d99d54ff305615cd91c03cd56895e0a7f6e9f35dbf89131044e2114a9a782b792b5661e3aff07faf125a98606a071@43.200.206.40:30303", "enode://209aaf7ed549cf4a5700fd833da25413f80a1248bd3aa7fe2a87203e3f7b236dd729579e5c8df61c97bf508281bae4969d6de76a7393bcbd04a0af70270333b3@54.216.248.9:30303"]
|
||||
# Uncomment below `bootnodes` field for Amoy
|
||||
# bootnodes = ["enode://bce861be777e91b0a5a49d58a51e14f32f201b4c6c2d1fbea6c7a1f14756cbb3f931f3188d6b65de8b07b53ff28d03b6e366d09e56360d2124a9fc5a15a0913d@54.217.171.196:30303", "enode://4a3dc0081a346d26a73d79dd88216a9402d2292318e2db9947dbc97ea9c4afb2498dc519c0af04420dc13a238c279062da0320181e7c1461216ce4513bfd40bf@13.251.184.185:30303"]
|
||||
# bootnodesv4 = []
|
||||
# bootnodesv5 = []
|
||||
# static-nodes = []
|
||||
# trusted-nodes = []
|
||||
# dns = []
|
||||
dns = [ "enrtree://AKUEZKN7PSKVNR65FZDHECMKOJQSGPARGTPPBI7WS2VUL4EGR6XPC@pos.polygon-peers.io" ] # For pos mainnet
|
||||
# Uncomment below `dns` field for Amoy
|
||||
# dns = [ "enrtree://AKUEZKN7PSKVNR65FZDHECMKOJQSGPARGTPPBI7WS2VUL4EGR6XPC@amoy.polygon-peers.io" ]
|
||||
|
||||
|
||||
# [heimdall]
|
||||
# url = "http://localhost:1317"
|
||||
|
|
@ -178,6 +181,7 @@ syncmode = "full"
|
|||
# [parallelevm]
|
||||
# enable = true
|
||||
# procs = 8
|
||||
# enforce = false
|
||||
|
||||
# [pprof]
|
||||
# pprof = false
|
||||
|
|
|
|||
|
|
@ -171,8 +171,6 @@ func runCmd(ctx *cli.Context) error {
|
|||
sender = common.HexToAddress(ctx.String(SenderFlag.Name))
|
||||
}
|
||||
|
||||
statedb.CreateAccount(sender)
|
||||
|
||||
if ctx.String(ReceiverFlag.Name) != "" {
|
||||
receiver = common.HexToAddress(ctx.String(ReceiverFlag.Name))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -547,7 +547,7 @@ func TestT9n(t *testing.T) {
|
|||
|
||||
switch {
|
||||
case err != nil:
|
||||
t.Logf(string(have))
|
||||
t.Log(string(have))
|
||||
t.Fatalf("test %d, json parsing failed: %v", i, err)
|
||||
case !ok:
|
||||
t.Fatalf("test %d: output wrong, have \n%v\nwant\n%v\n", i, string(have), string(want))
|
||||
|
|
@ -696,7 +696,7 @@ func TestB11r(t *testing.T) {
|
|||
|
||||
switch {
|
||||
case err != nil:
|
||||
t.Logf(string(have))
|
||||
t.Log(string(have))
|
||||
t.Fatalf("test %d, json parsing failed: %v", i, err)
|
||||
case !ok:
|
||||
t.Fatalf("test %d: output wrong, have \n%v\nwant\n%v\n", i, string(have), string(want))
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ func dump(in *inStream, s *rlp.Stream, depth int, out io.Writer) error {
|
|||
defer s.ListEnd()
|
||||
|
||||
if size == 0 {
|
||||
fmt.Fprintf(out, ws(depth)+"[]")
|
||||
fmt.Fprint(out, ws(depth)+"[]")
|
||||
} else {
|
||||
fmt.Fprintln(out, ws(depth)+"[")
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
package beacon
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/big"
|
||||
|
|
@ -398,9 +397,9 @@ func (beacon *Beacon) FinalizeAndAssemble(chain consensus.ChainHeaderReader, hea
|
|||
//
|
||||
// Note, the method returns immediately and will send the result async. More
|
||||
// than one result may also be returned depending on the consensus algorithm.
|
||||
func (beacon *Beacon) Seal(ctx context.Context, chain consensus.ChainHeaderReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error {
|
||||
func (beacon *Beacon) Seal(chain consensus.ChainHeaderReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error {
|
||||
if !beacon.IsPoSHeader(block.Header()) {
|
||||
return beacon.ethone.Seal(ctx, chain, block, results, stop)
|
||||
return beacon.ethone.Seal(chain, block, results, stop)
|
||||
}
|
||||
// The seal verification is done by the external consensus engine,
|
||||
// return directly without pushing any block back. In another word
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package abi
|
||||
|
||||
//go:generate mockgen -destination=./abi_mock.go -package=api . ABI
|
||||
type ABI interface {
|
||||
Pack(name string, args ...interface{}) ([]byte, error)
|
||||
UnpackIntoInterface(v interface{}, name string, data []byte) error
|
||||
68
consensus/bor/abi/abi_mock.go
Normal file
68
consensus/bor/abi/abi_mock.go
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: github.com/ethereum/go-ethereum/consensus/bor/abi (interfaces: ABI)
|
||||
|
||||
// Package abi is a generated GoMock package.
|
||||
package abi
|
||||
|
||||
import (
|
||||
reflect "reflect"
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
// MockABI is a mock of ABI interface.
|
||||
type MockABI struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockABIMockRecorder
|
||||
}
|
||||
|
||||
// MockABIMockRecorder is the mock recorder for MockABI.
|
||||
type MockABIMockRecorder struct {
|
||||
mock *MockABI
|
||||
}
|
||||
|
||||
// NewMockABI creates a new mock instance.
|
||||
func NewMockABI(ctrl *gomock.Controller) *MockABI {
|
||||
mock := &MockABI{ctrl: ctrl}
|
||||
mock.recorder = &MockABIMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||
func (m *MockABI) EXPECT() *MockABIMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// Pack mocks base method.
|
||||
func (m *MockABI) Pack(arg0 string, arg1 ...interface{}) ([]byte, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0}
|
||||
for _, a := range arg1 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "Pack", varargs...)
|
||||
ret0, _ := ret[0].([]byte)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// Pack indicates an expected call of Pack.
|
||||
func (mr *MockABIMockRecorder) Pack(arg0 interface{}, arg1 ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{arg0}, arg1...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Pack", reflect.TypeOf((*MockABI)(nil).Pack), varargs...)
|
||||
}
|
||||
|
||||
// UnpackIntoInterface mocks base method.
|
||||
func (m *MockABI) UnpackIntoInterface(arg0 interface{}, arg1 string, arg2 []byte) error {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "UnpackIntoInterface", arg0, arg1, arg2)
|
||||
ret0, _ := ret[0].(error)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// UnpackIntoInterface indicates an expected call of UnpackIntoInterface.
|
||||
func (mr *MockABIMockRecorder) UnpackIntoInterface(arg0, arg1, arg2 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnpackIntoInterface", reflect.TypeOf((*MockABI)(nil).UnpackIntoInterface), arg0, arg1, arg2)
|
||||
}
|
||||
|
|
@ -17,13 +17,10 @@ import (
|
|||
|
||||
lru "github.com/hashicorp/golang-lru"
|
||||
"github.com/holiman/uint256"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
"golang.org/x/crypto/sha3"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/tracing"
|
||||
balance_tracing "github.com/ethereum/go-ethereum/core/tracing"
|
||||
|
||||
"github.com/ethereum/go-ethereum/consensus"
|
||||
|
|
@ -468,9 +465,8 @@ func (c *Bor) verifyCascadingFields(chain consensus.ChainHeaderReader, header *t
|
|||
|
||||
// Verify the validator list match the local contract
|
||||
if IsSprintStart(number+1, c.config.CalculateSprint(number)) {
|
||||
// Use parent block's hash to make the eth_call to fetch validators so that the state being
|
||||
// used to make the call is of the same fork.
|
||||
newValidators, err := c.spanner.GetCurrentValidatorsByBlockNrOrHash(context.Background(), rpc.BlockNumberOrHashWithHash(header.ParentHash, false), number+1)
|
||||
newValidators, err := c.spanner.GetCurrentValidatorsByBlockNrOrHash(context.Background(), rpc.BlockNumberOrHashWithNumber(rpc.LatestBlockNumber), number+1)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -620,7 +616,7 @@ func (c *Bor) snapshot(chain consensus.ChainHeaderReader, number uint64, hash co
|
|||
headers[i], headers[len(headers)-1-i] = headers[len(headers)-1-i], headers[i]
|
||||
}
|
||||
|
||||
snap, err := snap.apply(headers)
|
||||
snap, err := snap.apply(headers, c)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -820,34 +816,35 @@ func (c *Bor) Prepare(chain consensus.ChainHeaderReader, header *types.Header) e
|
|||
// Finalize implements consensus.Engine, ensuring no uncles are set, nor block
|
||||
// rewards given.
|
||||
func (c *Bor) Finalize(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, body *types.Body) {
|
||||
headerNumber := header.Number.Uint64()
|
||||
if body.Withdrawals != nil || header.WithdrawalsHash != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var (
|
||||
stateSyncData []*types.StateSyncData
|
||||
err error
|
||||
)
|
||||
|
||||
headerNumber := header.Number.Uint64()
|
||||
|
||||
if body.Withdrawals != nil || header.WithdrawalsHash != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if IsSprintStart(headerNumber, c.config.CalculateSprint(headerNumber)) {
|
||||
ctx := context.Background()
|
||||
start := time.Now()
|
||||
cx := statefull.ChainContext{Chain: chain, Bor: c}
|
||||
// check and commit span
|
||||
if err := c.checkAndCommitSpan(ctx, state, header, cx); err != nil {
|
||||
if err := c.checkAndCommitSpan(state, header, cx); err != nil {
|
||||
log.Error("Error while committing span", "error", err)
|
||||
return
|
||||
}
|
||||
|
||||
if c.HeimdallClient != nil {
|
||||
// commit states
|
||||
stateSyncData, err = c.CommitStates(ctx, state, header, cx)
|
||||
stateSyncData, err = c.CommitStates(state, header, cx)
|
||||
if err != nil {
|
||||
log.Error("Error while committing states", "error", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
state.BorConsensusTime = time.Since(start)
|
||||
}
|
||||
|
||||
if err = c.changeContractCodeIfNeeded(headerNumber, state); err != nil {
|
||||
|
|
@ -905,38 +902,28 @@ func (c *Bor) changeContractCodeIfNeeded(headerNumber uint64, state *state.State
|
|||
// FinalizeAndAssemble implements consensus.Engine, ensuring no uncles are set,
|
||||
// nor block rewards given, and returns the final block.
|
||||
func (c *Bor) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, body *types.Body, receipts []*types.Receipt) (*types.Block, error) {
|
||||
finalizeCtx, finalizeSpan := tracing.StartSpan(context.Background(), "bor.FinalizeAndAssemble")
|
||||
defer tracing.EndSpan(finalizeSpan)
|
||||
|
||||
headerNumber := header.Number.Uint64()
|
||||
|
||||
if body.Withdrawals != nil || header.WithdrawalsHash != nil {
|
||||
return nil, consensus.ErrUnexpectedWithdrawals
|
||||
}
|
||||
|
||||
stateSyncData := []*types.StateSyncData{}
|
||||
|
||||
var err error
|
||||
var (
|
||||
stateSyncData []*types.StateSyncData
|
||||
err error
|
||||
)
|
||||
|
||||
if IsSprintStart(headerNumber, c.config.CalculateSprint(headerNumber)) {
|
||||
cx := statefull.ChainContext{Chain: chain, Bor: c}
|
||||
|
||||
tracing.Exec(finalizeCtx, "", "bor.checkAndCommitSpan", func(ctx context.Context, span trace.Span) {
|
||||
// check and commit span
|
||||
err = c.checkAndCommitSpan(finalizeCtx, state, header, cx)
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
// check and commit span
|
||||
if err = c.checkAndCommitSpan(state, header, cx); err != nil {
|
||||
log.Error("Error while committing span", "error", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if c.HeimdallClient != nil {
|
||||
tracing.Exec(finalizeCtx, "", "bor.checkAndCommitSpan", func(ctx context.Context, span trace.Span) {
|
||||
// commit states
|
||||
stateSyncData, err = c.CommitStates(finalizeCtx, state, header, cx)
|
||||
})
|
||||
|
||||
// commit states
|
||||
stateSyncData, err = c.CommitStates(state, header, cx)
|
||||
if err != nil {
|
||||
log.Error("Error while committing states", "error", err)
|
||||
return nil, err
|
||||
|
|
@ -944,19 +931,13 @@ func (c *Bor) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *typ
|
|||
}
|
||||
}
|
||||
|
||||
tracing.Exec(finalizeCtx, "", "bor.changeContractCodeIfNeeded", func(ctx context.Context, span trace.Span) {
|
||||
err = c.changeContractCodeIfNeeded(headerNumber, state)
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
if err = c.changeContractCodeIfNeeded(headerNumber, state); err != nil {
|
||||
log.Error("Error changing contract code", "error", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// No block rewards in PoA, so the state remains as it is
|
||||
tracing.Exec(finalizeCtx, "", "bor.IntermediateRoot", func(ctx context.Context, span trace.Span) {
|
||||
header.Root = state.IntermediateRoot(chain.Config().IsEIP158(header.Number))
|
||||
})
|
||||
header.Root = state.IntermediateRoot(chain.Config().IsEIP158(header.Number))
|
||||
|
||||
// Uncles are dropped
|
||||
header.UncleHash = types.CalcUncleHash(nil)
|
||||
|
|
@ -968,14 +949,6 @@ func (c *Bor) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *typ
|
|||
bc := chain.(core.BorStateSyncer)
|
||||
bc.SetStateSync(stateSyncData)
|
||||
|
||||
tracing.SetAttributes(
|
||||
finalizeSpan,
|
||||
attribute.Int("number", int(header.Number.Int64())),
|
||||
attribute.String("hash", header.Hash().String()),
|
||||
attribute.Int("number of txs", len(body.Transactions)),
|
||||
attribute.Int("gas used", int(block.GasUsed())),
|
||||
)
|
||||
|
||||
// return the final block for sealing
|
||||
return block, nil
|
||||
}
|
||||
|
|
@ -991,18 +964,7 @@ func (c *Bor) Authorize(currentSigner common.Address, signFn SignerFn) {
|
|||
|
||||
// Seal implements consensus.Engine, attempting to create a sealed block using
|
||||
// the local signing credentials.
|
||||
func (c *Bor) Seal(ctx context.Context, chain consensus.ChainHeaderReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error {
|
||||
_, sealSpan := tracing.StartSpan(ctx, "bor.Seal")
|
||||
|
||||
var endSpan bool = true
|
||||
|
||||
defer func() {
|
||||
// Only end span in case of early-returns/errors
|
||||
if endSpan {
|
||||
tracing.EndSpan(sealSpan)
|
||||
}
|
||||
}()
|
||||
|
||||
func (c *Bor) Seal(chain consensus.ChainHeaderReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error {
|
||||
header := block.Header()
|
||||
// Sealing the genesis block is not supported
|
||||
number := header.Number.Uint64()
|
||||
|
|
@ -1048,7 +1010,7 @@ func (c *Bor) Seal(ctx context.Context, chain consensus.ChainHeaderReader, block
|
|||
// Wait until sealing is terminated or delay timeout.
|
||||
log.Info("Waiting for slot to sign and propagate", "number", number, "hash", header.Hash, "delay-in-sec", uint(delay), "delay", common.PrettyDuration(delay))
|
||||
|
||||
go func(sealSpan trace.Span) {
|
||||
go func() {
|
||||
select {
|
||||
case <-stop:
|
||||
log.Debug("Discarding sealing operation for block", "number", number)
|
||||
|
|
@ -1071,27 +1033,13 @@ func (c *Bor) Seal(ctx context.Context, chain consensus.ChainHeaderReader, block
|
|||
"delay", delay,
|
||||
"headerDifficulty", header.Difficulty,
|
||||
)
|
||||
|
||||
tracing.SetAttributes(
|
||||
sealSpan,
|
||||
attribute.Int("number", int(number)),
|
||||
attribute.String("hash", header.Hash().String()),
|
||||
attribute.Int("delay", int(delay.Milliseconds())),
|
||||
attribute.Int("wiggle", int(wiggle.Milliseconds())),
|
||||
attribute.Bool("out-of-turn", wiggle > 0),
|
||||
)
|
||||
|
||||
tracing.EndSpan(sealSpan)
|
||||
}
|
||||
select {
|
||||
case results <- block.WithSeal(header):
|
||||
default:
|
||||
log.Warn("Sealing result was not read by miner", "number", number, "sealhash", SealHash(header, c.config))
|
||||
}
|
||||
}(sealSpan)
|
||||
|
||||
// Set the endSpan flag to false, as the go routine will handle it
|
||||
endSpan = false
|
||||
}()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1147,11 +1095,11 @@ func (c *Bor) Close() error {
|
|||
}
|
||||
|
||||
func (c *Bor) checkAndCommitSpan(
|
||||
ctx context.Context,
|
||||
state *state.StateDB,
|
||||
header *types.Header,
|
||||
chain core.ChainContext,
|
||||
) error {
|
||||
var ctx = context.Background()
|
||||
headerNumber := header.Number.Uint64()
|
||||
|
||||
span, err := c.spanner.GetCurrentSpan(ctx, header.ParentHash)
|
||||
|
|
@ -1225,7 +1173,6 @@ func (c *Bor) FetchAndCommitSpan(
|
|||
|
||||
// CommitStates commit states
|
||||
func (c *Bor) CommitStates(
|
||||
ctx context.Context,
|
||||
state *state.StateDB,
|
||||
header *types.Header,
|
||||
chain statefull.ChainContext,
|
||||
|
|
@ -1266,7 +1213,7 @@ func (c *Bor) CommitStates(
|
|||
"fromID", from,
|
||||
"to", to.Format(time.RFC3339))
|
||||
|
||||
eventRecords, err := c.HeimdallClient.StateSyncEvents(ctx, from, to.Unix())
|
||||
eventRecords, err := c.HeimdallClient.StateSyncEvents(context.Background(), from, to.Unix())
|
||||
if err != nil {
|
||||
log.Error("Error occurred when fetching state sync events", "fromID", from, "to", to.Unix(), "err", err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,13 @@ type ChainSpanner struct {
|
|||
validatorContractAddress common.Address
|
||||
}
|
||||
|
||||
// validator response on ValidatorSet contract
|
||||
type contractValidator struct {
|
||||
Id *big.Int
|
||||
Power *big.Int
|
||||
Signer common.Address
|
||||
}
|
||||
|
||||
func NewChainSpanner(ethAPI api.Caller, validatorSet abi.ABI, chainConfig *params.ChainConfig, validatorContractAddress common.Address) *ChainSpanner {
|
||||
return &ChainSpanner{
|
||||
ethAPI: ethAPI,
|
||||
|
|
@ -93,6 +100,139 @@ func (c *ChainSpanner) GetCurrentValidatorsByBlockNrOrHash(ctx context.Context,
|
|||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
|
||||
toAddress := c.validatorContractAddress
|
||||
gas := (hexutil.Uint64)(uint64(math.MaxUint64 / 2))
|
||||
|
||||
valz, err := c.tryGetBorValidatorsWithId(ctx, blockNrOrHash, blockNumber, toAddress, gas)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return valz, nil
|
||||
}
|
||||
|
||||
// tryGetBorValidatorsWithId Try to get bor validators with Id from ValidatorSet contract by querying each element on mapping(uint256 => Validator[]) public producers
|
||||
// If fails then returns GetBorValidators without id
|
||||
func (c *ChainSpanner) tryGetBorValidatorsWithId(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash, blockNumber uint64, toAddress common.Address, gas hexutil.Uint64) ([]*valset.Validator, error) {
|
||||
firstEndBlock, err := c.getFirstEndBlock(ctx, blockNrOrHash, toAddress, gas)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var spanNumber *big.Int
|
||||
if big.NewInt(int64(blockNumber)).Cmp(firstEndBlock) <= 0 {
|
||||
spanNumber = big.NewInt(0)
|
||||
} else {
|
||||
spanNumber, err = c.getSpanByBlock(ctx, blockNrOrHash, blockNumber, toAddress, gas)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
borValidatorsWithoutId, err := c.getBorValidatorsWithoutId(ctx, blockNrOrHash, blockNumber, toAddress, gas)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
producersCount := len(borValidatorsWithoutId)
|
||||
|
||||
valz := make([]*valset.Validator, producersCount)
|
||||
|
||||
for i := 0; i < producersCount; i++ {
|
||||
p, err := c.getProducersBySpanAndIndexMethod(ctx, blockNrOrHash, toAddress, gas, spanNumber, i)
|
||||
// if fails, return validators without id
|
||||
if err != nil {
|
||||
return borValidatorsWithoutId, nil
|
||||
}
|
||||
|
||||
valz[i] = &valset.Validator{
|
||||
ID: p.Id.Uint64(),
|
||||
Address: p.Signer,
|
||||
VotingPower: p.Power.Int64(),
|
||||
}
|
||||
}
|
||||
|
||||
return valz, nil
|
||||
}
|
||||
|
||||
func (c *ChainSpanner) getSpanByBlock(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash, blockNumber uint64, toAddress common.Address, gas hexutil.Uint64) (*big.Int, error) {
|
||||
const getSpanByBlockMethod = "getSpanByBlock"
|
||||
spanData, err := c.validatorSet.Pack(getSpanByBlockMethod, big.NewInt(0).SetUint64(blockNumber))
|
||||
if err != nil {
|
||||
log.Error("Unable to pack tx for getSpanByBlock", "error", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
spanMsgData := (hexutil.Bytes)(spanData)
|
||||
|
||||
spanResult, err := c.ethAPI.Call(ctx, ethapi.TransactionArgs{
|
||||
Gas: &gas,
|
||||
To: &toAddress,
|
||||
Data: &spanMsgData,
|
||||
}, &blockNrOrHash, nil, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var spanNumber *big.Int
|
||||
if err := c.validatorSet.UnpackIntoInterface(&spanNumber, getSpanByBlockMethod, spanResult); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return spanNumber, nil
|
||||
}
|
||||
|
||||
func (c *ChainSpanner) getProducersBySpanAndIndexMethod(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash, toAddress common.Address, gas hexutil.Uint64, spanNumber *big.Int, index int) (*contractValidator, error) {
|
||||
const getProducersBySpanAndIndexMethod = "producers"
|
||||
producerData, err := c.validatorSet.Pack(getProducersBySpanAndIndexMethod, spanNumber, big.NewInt(int64(index)))
|
||||
if err != nil {
|
||||
log.Error("Unable to pack tx for producers", "error", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
producerMsgData := (hexutil.Bytes)(producerData)
|
||||
|
||||
result, err := c.ethAPI.Call(ctx, ethapi.TransactionArgs{
|
||||
Gas: &gas,
|
||||
To: &toAddress,
|
||||
Data: &producerMsgData,
|
||||
}, &blockNrOrHash, nil, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var producer contractValidator
|
||||
if err := c.validatorSet.UnpackIntoInterface(&producer, getProducersBySpanAndIndexMethod, result); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &producer, nil
|
||||
}
|
||||
|
||||
func (c *ChainSpanner) getFirstEndBlock(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash, toAddress common.Address, gas hexutil.Uint64) (*big.Int, error) {
|
||||
const getFirstEndBlockMethod = "FIRST_END_BLOCK"
|
||||
firstEndBlockData, err := c.validatorSet.Pack(getFirstEndBlockMethod)
|
||||
if err != nil {
|
||||
log.Error("Unable to pack tx for getFirstEndBlock", "error", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
firstEndBlockMsgData := (hexutil.Bytes)(firstEndBlockData)
|
||||
|
||||
firstEndBlockResult, err := c.ethAPI.Call(ctx, ethapi.TransactionArgs{
|
||||
Gas: &gas,
|
||||
To: &toAddress,
|
||||
Data: &firstEndBlockMsgData,
|
||||
}, &blockNrOrHash, nil, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var firstEndBlockNumber *big.Int
|
||||
if err := c.validatorSet.UnpackIntoInterface(&firstEndBlockNumber, getFirstEndBlockMethod, firstEndBlockResult); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return firstEndBlockNumber, nil
|
||||
}
|
||||
|
||||
func (c *ChainSpanner) getBorValidatorsWithoutId(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash, blockNumber uint64, toAddress common.Address, gas hexutil.Uint64) ([]*valset.Validator, error) {
|
||||
// method
|
||||
const method = "getBorValidators"
|
||||
|
||||
|
|
@ -104,8 +244,6 @@ func (c *ChainSpanner) GetCurrentValidatorsByBlockNrOrHash(ctx context.Context,
|
|||
|
||||
// call
|
||||
msgData := (hexutil.Bytes)(data)
|
||||
toAddress := c.validatorContractAddress
|
||||
gas := (hexutil.Uint64)(uint64(math.MaxUint64 / 2))
|
||||
|
||||
result, err := c.ethAPI.Call(ctx, ethapi.TransactionArgs{
|
||||
Gas: &gas,
|
||||
|
|
|
|||
204
consensus/bor/heimdall/span/spanner_test.go
Normal file
204
consensus/bor/heimdall/span/spanner_test.go
Normal file
|
|
@ -0,0 +1,204 @@
|
|||
package span
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"math/big"
|
||||
"testing"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/consensus/bor/abi"
|
||||
"github.com/ethereum/go-ethereum/consensus/bor/api"
|
||||
"github.com/ethereum/go-ethereum/consensus/bor/valset"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
"github.com/ethereum/go-ethereum/rpc"
|
||||
"github.com/golang/mock/gomock"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestGetCurrentValidatorsByBlockNrOrHash(t *testing.T) {
|
||||
ctrl := gomock.NewController(t)
|
||||
defer ctrl.Finish()
|
||||
|
||||
chainConfig := ¶ms.ChainConfig{}
|
||||
validatorContractAddress := common.HexToAddress("0x1234567890123456789012345678901234567890")
|
||||
|
||||
testCases := []struct {
|
||||
name string
|
||||
blockNumber uint64
|
||||
mockEthAPIExpected func(*api.MockCaller)
|
||||
mockAbiExpected func(*abi.MockABI)
|
||||
expectedValidators []*valset.Validator
|
||||
expectError bool
|
||||
}{
|
||||
{
|
||||
name: "Successful retrieval of validators",
|
||||
blockNumber: 1000,
|
||||
mockEthAPIExpected: func(mockCaller *api.MockCaller) {
|
||||
mockCaller.EXPECT().Call(
|
||||
gomock.Any(),
|
||||
gomock.Any(),
|
||||
gomock.Any(),
|
||||
gomock.Any(),
|
||||
gomock.Any(),
|
||||
).Return(common.FromHex("0x0000000000000000000000000000000000000000000000000000000000000000"), nil).AnyTimes()
|
||||
},
|
||||
mockAbiExpected: func(mockAbi *abi.MockABI) {
|
||||
basicMocks(mockAbi)
|
||||
|
||||
callCount := 0
|
||||
mockAbi.EXPECT().UnpackIntoInterface(
|
||||
gomock.Any(),
|
||||
gomock.Eq("producers"),
|
||||
gomock.Any(),
|
||||
).DoAndReturn(func(v interface{}, name string, data []byte) error {
|
||||
defer func() { callCount++ }()
|
||||
|
||||
resp, _ := v.(*contractValidator)
|
||||
|
||||
if callCount == 0 {
|
||||
*resp = contractValidator{
|
||||
Id: big.NewInt(1),
|
||||
Signer: common.HexToAddress("0x1111111111111111111111111111111111111111"),
|
||||
Power: big.NewInt(10),
|
||||
}
|
||||
}
|
||||
if callCount == 1 {
|
||||
*resp = contractValidator{
|
||||
Id: big.NewInt(2),
|
||||
Signer: common.HexToAddress("0x2222222222222222222222222222222222222222"),
|
||||
Power: big.NewInt(15),
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}).AnyTimes()
|
||||
},
|
||||
expectedValidators: []*valset.Validator{
|
||||
{
|
||||
ID: 1,
|
||||
Address: common.HexToAddress("0x1111111111111111111111111111111111111111"),
|
||||
VotingPower: 10,
|
||||
},
|
||||
{
|
||||
ID: 2,
|
||||
Address: common.HexToAddress("0x2222222222222222222222222222222222222222"),
|
||||
VotingPower: 15,
|
||||
},
|
||||
},
|
||||
expectError: false,
|
||||
},
|
||||
{
|
||||
name: "Successful retrieval of validators without id",
|
||||
blockNumber: 1000,
|
||||
mockEthAPIExpected: func(mockCaller *api.MockCaller) {
|
||||
mockCaller.EXPECT().Call(
|
||||
gomock.Any(),
|
||||
gomock.Any(),
|
||||
gomock.Any(),
|
||||
gomock.Any(),
|
||||
gomock.Any(),
|
||||
).Return(common.FromHex("0x0000000000000000000000000000000000000000000000000000000000000000"), nil).AnyTimes()
|
||||
},
|
||||
mockAbiExpected: func(mockAbi *abi.MockABI) {
|
||||
basicMocks(mockAbi)
|
||||
|
||||
mockAbi.EXPECT().UnpackIntoInterface(
|
||||
gomock.Any(),
|
||||
gomock.Eq("producers"),
|
||||
gomock.Any(),
|
||||
).DoAndReturn(func(v interface{}, name string, data []byte) error {
|
||||
return fmt.Errorf("failed")
|
||||
}).AnyTimes()
|
||||
},
|
||||
expectedValidators: []*valset.Validator{
|
||||
{
|
||||
ID: 0,
|
||||
Address: common.HexToAddress("0x1111111111111111111111111111111111111111"),
|
||||
VotingPower: 10,
|
||||
},
|
||||
{
|
||||
ID: 0,
|
||||
Address: common.HexToAddress("0x2222222222222222222222222222222222222222"),
|
||||
VotingPower: 15,
|
||||
},
|
||||
},
|
||||
expectError: false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
mockEthAPI := api.NewMockCaller(ctrl)
|
||||
mockValidatorSetABI := abi.NewMockABI(ctrl)
|
||||
|
||||
// Setup
|
||||
chainSpanner := NewChainSpanner(
|
||||
mockEthAPI,
|
||||
mockValidatorSetABI,
|
||||
chainConfig,
|
||||
validatorContractAddress,
|
||||
)
|
||||
|
||||
// Set up mock expectations
|
||||
tc.mockEthAPIExpected(mockEthAPI)
|
||||
tc.mockAbiExpected(mockValidatorSetABI)
|
||||
|
||||
blockNumber := rpc.BlockNumber(tc.blockNumber)
|
||||
blockNrOrHash := rpc.BlockNumberOrHashWithNumber(blockNumber)
|
||||
|
||||
// Execute method
|
||||
validators, err := chainSpanner.GetCurrentValidatorsByBlockNrOrHash(context.Background(), blockNrOrHash, tc.blockNumber)
|
||||
|
||||
// Assertions
|
||||
if tc.expectError {
|
||||
assert.Error(t, err)
|
||||
assert.Nil(t, validators)
|
||||
} else {
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, tc.expectedValidators, validators)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func basicMocks(mockAbi *abi.MockABI) {
|
||||
mockAbi.EXPECT().Pack(
|
||||
gomock.Any(),
|
||||
gomock.Any(),
|
||||
).Return(common.FromHex("0x0000000000000000000000000000000000000000000000000000000000000000"), nil).AnyTimes()
|
||||
|
||||
mockAbi.EXPECT().UnpackIntoInterface(
|
||||
gomock.Any(),
|
||||
gomock.Eq("FIRST_END_BLOCK"),
|
||||
gomock.Any(),
|
||||
).DoAndReturn(func(v interface{}, name string, data []byte) error {
|
||||
resp, _ := v.(**big.Int)
|
||||
*resp = big.NewInt(999)
|
||||
return nil
|
||||
}).AnyTimes()
|
||||
|
||||
mockAbi.EXPECT().UnpackIntoInterface(
|
||||
gomock.Any(),
|
||||
gomock.Eq("getSpanByBlock"),
|
||||
gomock.Any(),
|
||||
).DoAndReturn(func(v interface{}, name string, data []byte) error {
|
||||
resp, _ := v.(**big.Int)
|
||||
*resp = big.NewInt(1)
|
||||
return nil
|
||||
}).AnyTimes()
|
||||
|
||||
mockAbi.EXPECT().UnpackIntoInterface(
|
||||
gomock.Any(),
|
||||
gomock.Eq("getBorValidators"),
|
||||
gomock.Any(),
|
||||
).DoAndReturn(func(v interface{}, name string, data []byte) error {
|
||||
resp, _ := v.(*[]interface{})
|
||||
ret0, _ := (*resp)[0].(*[]common.Address)
|
||||
ret1, _ := (*resp)[1].(*[]*big.Int)
|
||||
|
||||
*ret0 = []common.Address{common.HexToAddress("0x1111111111111111111111111111111111111111"), common.HexToAddress("0x2222222222222222222222222222222222222222")}
|
||||
*ret1 = []*big.Int{big.NewInt(10), big.NewInt(15)}
|
||||
|
||||
return nil
|
||||
}).AnyTimes()
|
||||
}
|
||||
|
|
@ -1,9 +1,11 @@
|
|||
package bor
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/ethereum/go-ethereum/consensus/bor/valset"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
|
||||
lru "github.com/hashicorp/golang-lru"
|
||||
|
||||
|
|
@ -100,7 +102,7 @@ func (s *Snapshot) copy() *Snapshot {
|
|||
return cpy
|
||||
}
|
||||
|
||||
func (s *Snapshot) apply(headers []*types.Header) (*Snapshot, error) {
|
||||
func (s *Snapshot) apply(headers []*types.Header, c *Bor) (*Snapshot, error) {
|
||||
// Allow passing in no headers for cleaner code
|
||||
if len(headers) == 0 {
|
||||
return s, nil
|
||||
|
|
@ -157,6 +159,12 @@ func (s *Snapshot) apply(headers []*types.Header) (*Snapshot, error) {
|
|||
newVals, _ := valset.ParseValidators(validatorBytes)
|
||||
v := getUpdatedValidatorSet(snap.ValidatorSet.Copy(), newVals)
|
||||
v.IncrementProposerPriority(1)
|
||||
|
||||
if v.CheckEmptyId() {
|
||||
log.Warn("Empty id found on validator set. Querying on the validatorSet contract")
|
||||
valsWithId, _ := c.spanner.GetCurrentValidatorsByHash(context.Background(), header.Hash(), number+1)
|
||||
v.IncludeIds(valsWithId)
|
||||
}
|
||||
snap.ValidatorSet = v
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,6 +100,11 @@ func ApplyMessage(
|
|||
log.Error("message execution failed on contract", "msgData", msg.Data)
|
||||
}
|
||||
|
||||
// If there's error committing span, log it here. It won't be reported before because the return value is empty.
|
||||
if bytes.Equal(msg.To().Bytes(), validatorContract.Bytes()) && err != nil {
|
||||
log.Error("message execution failed on contract", "err", err)
|
||||
}
|
||||
|
||||
// Update the state with pending changes
|
||||
if err != nil {
|
||||
state.Finalise(true)
|
||||
|
|
|
|||
|
|
@ -110,6 +110,36 @@ func (vals *ValidatorSet) IncrementProposerPriority(times int) {
|
|||
vals.Proposer = proposer
|
||||
}
|
||||
|
||||
// IncludeIds include the proper Id of each validator by getting the id from
|
||||
// validator queried on ValidatorSet contract
|
||||
func (vals *ValidatorSet) IncludeIds(valsWithId []*Validator) {
|
||||
if vals.IsNilOrEmpty() {
|
||||
log.Warn("Empty validator set")
|
||||
}
|
||||
|
||||
addressToId := make(map[common.Address]uint64)
|
||||
|
||||
for _, val := range valsWithId {
|
||||
addressToId[val.Address] = val.ID
|
||||
}
|
||||
|
||||
for _, val := range vals.Validators {
|
||||
val.ID = addressToId[val.Address]
|
||||
}
|
||||
}
|
||||
|
||||
// CheckEmptyId checks if any validator in the ValidatorSet has an empty ID (ID == 0).
|
||||
// Returns true if at least one validator has an empty ID.
|
||||
// Returns false if all validators have non-zero IDs or if the ValidatorSet is empty.
|
||||
func (vals *ValidatorSet) CheckEmptyId() bool {
|
||||
for _, val := range vals.Validators {
|
||||
if val.ID == 0 {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (vals *ValidatorSet) RescalePriorities(diffMax int64) {
|
||||
if vals.IsNilOrEmpty() {
|
||||
panic("empty validator set")
|
||||
|
|
|
|||
|
|
@ -197,3 +197,119 @@ func TestUpdateWithChangeSet(t *testing.T) {
|
|||
_, updatedTempVal := valSet.GetByAddress(tempVal.Address)
|
||||
require.Equal(t, int64(250), updatedTempVal.VotingPower)
|
||||
}
|
||||
|
||||
func TestValidatorSet_IncludeIds(t *testing.T) {
|
||||
v1 := &Validator{
|
||||
Address: common.HexToAddress("0x1111111111111111111111111111111111111111"),
|
||||
VotingPower: 100,
|
||||
ProposerPriority: 0,
|
||||
ID: 0,
|
||||
}
|
||||
v2 := &Validator{
|
||||
Address: common.HexToAddress("0x2222222222222222222222222222222222222222"),
|
||||
VotingPower: 200,
|
||||
ProposerPriority: 0,
|
||||
ID: 0,
|
||||
}
|
||||
|
||||
valSet := NewValidatorSet([]*Validator{v1, v2})
|
||||
|
||||
valsWithId := []*Validator{
|
||||
{
|
||||
Address: v1.Address,
|
||||
ID: 10, // new ID for v1
|
||||
VotingPower: 999,
|
||||
ProposerPriority: 999,
|
||||
},
|
||||
{
|
||||
Address: v2.Address,
|
||||
ID: 20, // new ID for v2
|
||||
VotingPower: 999,
|
||||
ProposerPriority: 999,
|
||||
},
|
||||
{
|
||||
Address: common.HexToAddress("0x3333333333333333333333333333333333333333"),
|
||||
ID: 30,
|
||||
VotingPower: 300,
|
||||
},
|
||||
}
|
||||
|
||||
valSet.IncludeIds(valsWithId)
|
||||
|
||||
assert.Equal(t, uint64(10), valSet.Validators[0].ID, "v1 ID should be updated to 10")
|
||||
assert.Equal(t, uint64(20), valSet.Validators[1].ID, "v2 ID should be updated to 20")
|
||||
|
||||
assert.Equal(t, 2, len(valSet.Validators), "No extra validators should be added")
|
||||
|
||||
assert.Equal(t, int64(100), valSet.Validators[0].VotingPower)
|
||||
assert.Equal(t, int64(200), valSet.Validators[1].VotingPower)
|
||||
}
|
||||
|
||||
func TestValidatorSet_IncludeIds_EmptySet(t *testing.T) {
|
||||
valSet := NewValidatorSet(nil) // empty set
|
||||
|
||||
valSet.IncludeIds([]*Validator{
|
||||
{
|
||||
Address: common.HexToAddress("0xabcdef"),
|
||||
ID: 42,
|
||||
},
|
||||
})
|
||||
|
||||
assert.Equal(t, 0, valSet.Size(), "ValidatorSet remains empty")
|
||||
}
|
||||
|
||||
func TestCheckEmptyId(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
validatorSet ValidatorSet
|
||||
expected bool
|
||||
}{
|
||||
{
|
||||
name: "Empty ValidatorSet",
|
||||
validatorSet: ValidatorSet{Validators: []*Validator{}},
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
name: "All Validators with Non-Zero IDs",
|
||||
validatorSet: ValidatorSet{
|
||||
Validators: []*Validator{
|
||||
{ID: 1},
|
||||
{ID: 2},
|
||||
{ID: 3},
|
||||
},
|
||||
},
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
name: "One Validator with ID Zero",
|
||||
validatorSet: ValidatorSet{
|
||||
Validators: []*Validator{
|
||||
{ID: 0},
|
||||
{ID: 2},
|
||||
{ID: 3},
|
||||
},
|
||||
},
|
||||
expected: true,
|
||||
},
|
||||
{
|
||||
name: "All Validators with ID Zero",
|
||||
validatorSet: ValidatorSet{
|
||||
Validators: []*Validator{
|
||||
{ID: 0},
|
||||
{ID: 0},
|
||||
{ID: 0},
|
||||
},
|
||||
},
|
||||
expected: true,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
result := tt.validatorSet.CheckEmptyId()
|
||||
if result != tt.expected {
|
||||
t.Errorf("expected %v, got %v", tt.expected, result)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ package clique
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
|
@ -652,7 +651,7 @@ func (c *Clique) Authorize(signer common.Address, signFn SignerFn) {
|
|||
|
||||
// Seal implements consensus.Engine, attempting to create a sealed block using
|
||||
// the local signing credentials.
|
||||
func (c *Clique) Seal(ctx context.Context, chain consensus.ChainHeaderReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error {
|
||||
func (c *Clique) Seal(chain consensus.ChainHeaderReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error {
|
||||
header := block.Header()
|
||||
|
||||
// Sealing the genesis block is not supported
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
package consensus
|
||||
|
||||
import (
|
||||
"context"
|
||||
"math/big"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
|
|
@ -103,7 +102,7 @@ type Engine interface {
|
|||
//
|
||||
// Note, the method returns immediately and will send the result async. More
|
||||
// than one result may also be returned depending on the consensus algorithm.
|
||||
Seal(ctx context.Context, chain ChainHeaderReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error
|
||||
Seal(chain ChainHeaderReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error
|
||||
|
||||
// SealHash returns the hash of a block prior to it being sealed.
|
||||
SealHash(header *types.Header) common.Hash
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
package ethash
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/consensus"
|
||||
|
|
@ -81,6 +80,6 @@ func (ethash *Ethash) APIs(chain consensus.ChainHeaderReader) []rpc.API {
|
|||
// Seal generates a new sealing request for the given input block and pushes
|
||||
// the result into the given channel. For the ethash engine, this method will
|
||||
// just panic as sealing is not supported anymore.
|
||||
func (ethash *Ethash) Seal(ctx context.Context, chain consensus.ChainHeaderReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error {
|
||||
func (ethash *Ethash) Seal(chain consensus.ChainHeaderReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error {
|
||||
panic("ethash (pow) sealing not supported any more")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,6 +82,8 @@ var (
|
|||
snapshotStorageReadTimer = metrics.NewRegisteredResettingTimer("chain/snapshot/storage/reads", nil)
|
||||
snapshotCommitTimer = metrics.NewRegisteredResettingTimer("chain/snapshot/commits", nil)
|
||||
|
||||
borConsensusTime = metrics.NewRegisteredTimer("chain/bor/consensus", nil)
|
||||
|
||||
blockImportTimer = metrics.NewRegisteredMeter("chain/imports", nil)
|
||||
triedbCommitTimer = metrics.NewRegisteredTimer("chain/triedb/commits", nil)
|
||||
|
||||
|
|
@ -279,6 +281,7 @@ type BlockChain struct {
|
|||
processor Processor // Block transaction processor interface
|
||||
parallelProcessor Processor // Parallel block transaction processor interface
|
||||
parallelSpeculativeProcesses int // Number of parallel speculative processes
|
||||
enforceParallelProcessor bool
|
||||
forker *ForkChoice
|
||||
vmConfig vm.Config
|
||||
logger *tracing.Hooks
|
||||
|
|
@ -549,7 +552,7 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis *Genesis
|
|||
}
|
||||
|
||||
// NewParallelBlockChain , similar to NewBlockChain, creates a new blockchain object, but with a parallel state processor
|
||||
func NewParallelBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis *Genesis, overrides *ChainOverrides, engine consensus.Engine, vmConfig vm.Config, shouldPreserve func(header *types.Header) bool, txLookupLimit *uint64, checker ethereum.ChainValidator, numprocs int) (*BlockChain, error) {
|
||||
func NewParallelBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis *Genesis, overrides *ChainOverrides, engine consensus.Engine, vmConfig vm.Config, shouldPreserve func(header *types.Header) bool, txLookupLimit *uint64, checker ethereum.ChainValidator, numprocs int, enforce bool) (*BlockChain, error) {
|
||||
bc, err := NewBlockChain(db, cacheConfig, genesis, overrides, engine, vmConfig, shouldPreserve, txLookupLimit, checker)
|
||||
|
||||
if err != nil {
|
||||
|
|
@ -567,6 +570,7 @@ func NewParallelBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis
|
|||
|
||||
bc.parallelProcessor = NewParallelStateProcessor(chainConfig, bc, engine)
|
||||
bc.parallelSpeculativeProcesses = numprocs
|
||||
bc.enforceParallelProcessor = enforce
|
||||
|
||||
return bc, nil
|
||||
}
|
||||
|
|
@ -602,7 +606,12 @@ func (bc *BlockChain) ProcessBlock(block *types.Block, parent *types.Header) (_
|
|||
parallel bool
|
||||
}
|
||||
|
||||
resultChan := make(chan Result, 2)
|
||||
var resultChanLen int = 2
|
||||
if bc.enforceParallelProcessor {
|
||||
log.Debug("Processing block using Block STM only", "number", block.NumberU64())
|
||||
resultChanLen = 1
|
||||
}
|
||||
resultChan := make(chan Result, resultChanLen)
|
||||
|
||||
processorCount := 0
|
||||
|
||||
|
|
@ -629,7 +638,7 @@ func (bc *BlockChain) ProcessBlock(block *types.Block, parent *types.Header) (_
|
|||
}()
|
||||
}
|
||||
|
||||
if bc.processor != nil {
|
||||
if bc.processor != nil && !bc.enforceParallelProcessor {
|
||||
statedb, err := state.New(parent.Root, bc.stateCache, bc.snaps)
|
||||
if err != nil {
|
||||
return nil, nil, 0, nil, 0, err
|
||||
|
|
@ -1920,18 +1929,18 @@ func (bc *BlockChain) writeBlockWithState(block *types.Block, receipts []*types.
|
|||
|
||||
// WriteBlockAndSetHead writes the given block and all associated state to the database,
|
||||
// and applies the block as the new chain head.
|
||||
func (bc *BlockChain) WriteBlockAndSetHead(ctx context.Context, block *types.Block, receipts []*types.Receipt, logs []*types.Log, state *state.StateDB, emitHeadEvent bool) (status WriteStatus, err error) {
|
||||
func (bc *BlockChain) WriteBlockAndSetHead(block *types.Block, receipts []*types.Receipt, logs []*types.Log, state *state.StateDB, emitHeadEvent bool) (status WriteStatus, err error) {
|
||||
if !bc.chainmu.TryLock() {
|
||||
return NonStatTy, errChainStopped
|
||||
}
|
||||
defer bc.chainmu.Unlock()
|
||||
|
||||
return bc.writeBlockAndSetHead(ctx, block, receipts, logs, state, emitHeadEvent)
|
||||
return bc.writeBlockAndSetHead(block, receipts, logs, state, emitHeadEvent)
|
||||
}
|
||||
|
||||
// writeBlockAndSetHead is the internal implementation of WriteBlockAndSetHead.
|
||||
// This function expects the chain mutex to be held.
|
||||
func (bc *BlockChain) writeBlockAndSetHead(ctx context.Context, block *types.Block, receipts []*types.Receipt, logs []*types.Log, state *state.StateDB, emitHeadEvent bool) (status WriteStatus, err error) {
|
||||
func (bc *BlockChain) writeBlockAndSetHead(block *types.Block, receipts []*types.Receipt, logs []*types.Log, state *state.StateDB, emitHeadEvent bool) (status WriteStatus, err error) {
|
||||
stateSyncLogs, err := bc.writeBlockWithState(block, receipts, logs, state)
|
||||
if err != nil {
|
||||
return NonStatTy, err
|
||||
|
|
@ -2355,7 +2364,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error)
|
|||
bc.stateSyncFeed.Send(StateSyncEvent{Data: data})
|
||||
}
|
||||
// BOR
|
||||
ptime := time.Since(pstart) - vtime
|
||||
ptime := time.Since(pstart) - vtime - statedb.BorConsensusTime
|
||||
|
||||
proctime := time.Since(start) // processing + validation
|
||||
|
||||
|
|
@ -2374,7 +2383,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error)
|
|||
trieRead += statedb.SnapshotStorageReads + statedb.StorageReads // The time spent on storage read
|
||||
blockExecutionTimer.Update(ptime - trieRead) // The time spent on EVM processing
|
||||
blockValidationTimer.Update(vtime - (triehash + trieUpdate)) // The time spent on block validation
|
||||
|
||||
borConsensusTime.Update(statedb.BorConsensusTime) // The time spent on bor consensus (span + state sync)
|
||||
// Write the block to the chain and get the status.
|
||||
var (
|
||||
wstart = time.Now()
|
||||
|
|
@ -2384,7 +2393,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error)
|
|||
// Before the actual db insertion happens, verify the block against the whitelisted
|
||||
// milestone and checkpoint. This is to prevent a race condition where a milestone
|
||||
// or checkpoint was whitelisted while the block execution happened (and wasn't
|
||||
// available sometime before) and the block turns out to be inavlid (i.e. not
|
||||
// available sometime before) and the block turns out to be invalid (i.e. not
|
||||
// honouring the milestone or checkpoint). Use the block itself as current block
|
||||
// so that it's considered as a `past` chain and the validation doesn't get bypassed.
|
||||
isValid, err = bc.forker.ValidateReorg(block.Header(), []*types.Header{block.Header()})
|
||||
|
|
@ -2399,7 +2408,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error)
|
|||
// Don't set the head, only insert the block
|
||||
_, err = bc.writeBlockWithState(block, receipts, logs, statedb)
|
||||
} else {
|
||||
status, err = bc.writeBlockAndSetHead(context.Background(), block, receipts, logs, statedb, false)
|
||||
status, err = bc.writeBlockAndSetHead(block, receipts, logs, statedb, false)
|
||||
}
|
||||
|
||||
followupInterrupt.Store(true)
|
||||
|
|
@ -2572,7 +2581,7 @@ func (bc *BlockChain) processBlock(block *types.Block, statedb *state.StateDB, s
|
|||
// Don't set the head, only insert the block
|
||||
_, err = bc.writeBlockWithState(block, receipts, logs, statedb)
|
||||
} else {
|
||||
status, err = bc.writeBlockAndSetHead(context.Background(), block, receipts, logs, statedb, false)
|
||||
status, err = bc.writeBlockAndSetHead(block, receipts, logs, statedb, false)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
|
|
@ -195,11 +195,14 @@ func testBlockChainImport(chain types.Blocks, blockchain *BlockChain) error {
|
|||
func TestParallelBlockChainImport(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
testParallelBlockChainImport(t, rawdb.HashScheme)
|
||||
testParallelBlockChainImport(t, rawdb.PathScheme)
|
||||
testParallelBlockChainImport(t, rawdb.HashScheme, false)
|
||||
testParallelBlockChainImport(t, rawdb.PathScheme, false)
|
||||
|
||||
testParallelBlockChainImport(t, rawdb.HashScheme, true)
|
||||
testParallelBlockChainImport(t, rawdb.PathScheme, true)
|
||||
}
|
||||
|
||||
func testParallelBlockChainImport(t *testing.T, scheme string) {
|
||||
func testParallelBlockChainImport(t *testing.T, scheme string, enforceParallelProcessor bool) {
|
||||
db, _, blockchain, err := newCanonical(ethash.NewFaker(), 10, true, scheme)
|
||||
blockchain.parallelProcessor = NewParallelStateProcessor(blockchain.chainConfig, blockchain, blockchain.engine)
|
||||
|
||||
|
|
@ -207,6 +210,8 @@ func testParallelBlockChainImport(t *testing.T, scheme string) {
|
|||
t.Fatalf("failed to make new canonical chain: %v", err)
|
||||
}
|
||||
|
||||
// If required, enforce parallel block processing and skip serial processing completely
|
||||
blockchain.enforceParallelProcessor = enforceParallelProcessor
|
||||
defer blockchain.Stop()
|
||||
|
||||
block := blockchain.GetBlockByHash(blockchain.CurrentBlock().Hash())
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ import (
|
|||
type ParallelEVMConfig struct {
|
||||
Enable bool
|
||||
SpeculativeProcesses int
|
||||
Enforce bool
|
||||
}
|
||||
|
||||
// StateProcessor is a basic Processor, which takes care of transitioning
|
||||
|
|
|
|||
|
|
@ -422,7 +422,7 @@ func TestBlockReceiptStorage(t *testing.T) {
|
|||
t.Fatalf("no receipts returned")
|
||||
} else {
|
||||
if err := checkReceiptsRLP(rs, receipts); err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
}
|
||||
// Delete the body and ensure that the receipts are no longer returned (metadata can't be recomputed)
|
||||
|
|
@ -432,7 +432,7 @@ func TestBlockReceiptStorage(t *testing.T) {
|
|||
}
|
||||
// Ensure that receipts without metadata can be returned without the block body too
|
||||
if err := checkReceiptsRLP(ReadRawReceipts(db, hash, 0), receipts); err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
// Sanity check that body alone without the receipt is a full purge
|
||||
WriteBody(db, hash, 0, body)
|
||||
|
|
|
|||
|
|
@ -92,6 +92,16 @@ func InitDatabaseFromFreezer(db ethdb.Database) {
|
|||
log.Info("Initialized database from freezer", "blocks", frozen, "elapsed", common.PrettyDuration(time.Since(start)))
|
||||
}
|
||||
|
||||
// adjustRangeForBor updates the range to index transactions if the ancient data was pruned before. This is
|
||||
// to avoid indexing/unindexing data which is already pruned (i.e. before the `offset` block number).
|
||||
func adjustRangeForBor(db ethdb.Database, from uint64) uint64 {
|
||||
if offset := db.AncientOffSet(); offset > from {
|
||||
from = offset
|
||||
}
|
||||
|
||||
return from
|
||||
}
|
||||
|
||||
type blockTxHashes struct {
|
||||
number uint64
|
||||
hashes []common.Hash
|
||||
|
|
@ -108,10 +118,6 @@ func iterateTransactions(db ethdb.Database, from uint64, to uint64, reverse bool
|
|||
rlp rlp.RawValue
|
||||
}
|
||||
|
||||
if offset := db.AncientOffSet(); offset > from {
|
||||
from = offset
|
||||
}
|
||||
|
||||
if to <= from {
|
||||
return nil
|
||||
}
|
||||
|
|
@ -206,6 +212,9 @@ func iterateTransactions(db ethdb.Database, from uint64, to uint64, reverse bool
|
|||
// There is a passed channel, the whole procedure will be interrupted if any
|
||||
// signal received.
|
||||
func indexTransactions(db ethdb.Database, from uint64, to uint64, interrupt chan struct{}, hook func(uint64) bool, report bool) {
|
||||
// Adjust range if needed
|
||||
from = adjustRangeForBor(db, from)
|
||||
|
||||
// short circuit for invalid range
|
||||
if from >= to {
|
||||
return
|
||||
|
|
@ -309,6 +318,9 @@ func indexTransactionsForTesting(db ethdb.Database, from uint64, to uint64, inte
|
|||
// There is a passed channel, the whole procedure will be interrupted if any
|
||||
// signal received.
|
||||
func unindexTransactions(db ethdb.Database, from uint64, to uint64, interrupt chan struct{}, hook func(uint64) bool, report bool) {
|
||||
// Adjust range if needed
|
||||
from = adjustRangeForBor(db, from)
|
||||
|
||||
// short circuit for invalid range
|
||||
if from >= to {
|
||||
return
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ func WriteOffsetOfLastAncientFreezer(db ethdb.KeyValueWriter, offset uint64) {
|
|||
|
||||
// NewDatabaseWithOnlyFreezer create a freezer db without state
|
||||
func NewDatabaseWithOnlyFreezer(db ethdb.KeyValueStore, frz, namespace string, readonly bool, newOffSet uint64) (*Freezer, error) {
|
||||
// Create the idle freezer instance, this operation should be atomic to avoid mismatch between offset and acientDB.
|
||||
// Create the idle freezer instance, this operation should be atomic to avoid mismatch between offset and ancientDB.
|
||||
frdb, err := NewChainFreezer(frz, namespace, readonly, newOffSet)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ func NewFreezer(datadir string, namespace string, readonly bool, offset uint64,
|
|||
}
|
||||
|
||||
// Some blocks in ancientDB may have already been frozen and been pruned, so adding the offset to
|
||||
// reprensent the absolute number of blocks already frozen.
|
||||
// represent the absolute number of blocks already frozen.
|
||||
freezer.frozen.Add(offset)
|
||||
|
||||
// Create the write batch.
|
||||
|
|
|
|||
|
|
@ -174,6 +174,9 @@ type StateDB struct {
|
|||
SnapshotCommits time.Duration
|
||||
TrieDBCommits time.Duration
|
||||
|
||||
// Bor metrics
|
||||
BorConsensusTime time.Duration
|
||||
|
||||
AccountUpdated int
|
||||
StorageUpdated atomic.Int64
|
||||
AccountDeleted int
|
||||
|
|
|
|||
|
|
@ -71,9 +71,11 @@ func TestTxIndexer(t *testing.T) {
|
|||
}
|
||||
verify := func(db ethdb.Database, expTail uint64, indexer *txIndexer) {
|
||||
tail := rawdb.ReadTxIndexTail(db)
|
||||
//nolint: staticcheck
|
||||
if tail == nil {
|
||||
t.Fatal("Failed to write tx index tail")
|
||||
}
|
||||
//nolint: staticcheck
|
||||
if *tail != expTail {
|
||||
t.Fatalf("Unexpected tx index tail, want %v, got %d", expTail, *tail)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,12 +100,8 @@ var (
|
|||
localGauge = metrics.NewRegisteredGauge("txpool/local", nil)
|
||||
slotsGauge = metrics.NewRegisteredGauge("txpool/slots", nil)
|
||||
|
||||
resetCacheGauge = metrics.NewRegisteredGauge("txpool/resetcache", nil)
|
||||
reinitCacheGauge = metrics.NewRegisteredGauge("txpool/reinittcache", nil)
|
||||
hitCacheCounter = metrics.NewRegisteredCounter("txpool/cachehit", nil)
|
||||
missCacheCounter = metrics.NewRegisteredCounter("txpool/cachemiss", nil)
|
||||
|
||||
reheapTimer = metrics.NewRegisteredTimer("txpool/reheap", nil)
|
||||
resetCacheGauge = metrics.NewRegisteredGauge("txpool/resetcache", nil)
|
||||
reheapTimer = metrics.NewRegisteredTimer("txpool/reheap", nil)
|
||||
)
|
||||
|
||||
// BlockChain defines the minimal set of methods needed to back a tx pool with
|
||||
|
|
|
|||
|
|
@ -58,29 +58,22 @@ func (h *nonceHeap) Pop() interface{} {
|
|||
// sortedMap is a nonce->transaction hash map with a heap based index to allow
|
||||
// iterating over the contents in a nonce-incrementing way.
|
||||
type sortedMap struct {
|
||||
items map[uint64]*types.Transaction // Hash map storing the transaction data
|
||||
index *nonceHeap // Heap of nonces of all the stored transactions (non-strict mode)
|
||||
m sync.RWMutex
|
||||
|
||||
cache types.Transactions // Cache of the transactions already sorted
|
||||
isEmpty bool
|
||||
items map[uint64]*types.Transaction // Hash map storing the transaction data
|
||||
index *nonceHeap // Heap of nonces of all the stored transactions (non-strict mode)
|
||||
cache types.Transactions // Cache of the transactions already sorted
|
||||
cacheMu sync.RWMutex
|
||||
}
|
||||
|
||||
// newSortedMap creates a new nonce-sorted transaction map.
|
||||
func newSortedMap() *sortedMap {
|
||||
return &sortedMap{
|
||||
items: make(map[uint64]*types.Transaction),
|
||||
index: new(nonceHeap),
|
||||
isEmpty: true,
|
||||
items: make(map[uint64]*types.Transaction),
|
||||
index: new(nonceHeap),
|
||||
}
|
||||
}
|
||||
|
||||
// Get retrieves the current transactions associated with the given nonce.
|
||||
func (m *sortedMap) Get(nonce uint64) *types.Transaction {
|
||||
m.m.RLock()
|
||||
defer m.m.RUnlock()
|
||||
|
||||
return m.items[nonce]
|
||||
}
|
||||
|
||||
|
|
@ -89,28 +82,18 @@ func (m *sortedMap) Has(nonce uint64) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
m.m.RLock()
|
||||
defer m.m.RUnlock()
|
||||
|
||||
return m.items[nonce] != nil
|
||||
}
|
||||
|
||||
// Put inserts a new transaction into the map, also updating the map's nonce
|
||||
// index. If a transaction already exists with the same nonce, it's overwritten.
|
||||
func (m *sortedMap) Put(tx *types.Transaction) {
|
||||
m.m.Lock()
|
||||
defer m.m.Unlock()
|
||||
|
||||
nonce := tx.Nonce()
|
||||
if m.items[nonce] == nil {
|
||||
heap.Push(m.index, nonce)
|
||||
}
|
||||
|
||||
m.items[nonce] = tx
|
||||
|
||||
m.cacheMu.Lock()
|
||||
m.isEmpty = true
|
||||
m.cache = nil
|
||||
m.items[nonce], m.cache = tx, nil
|
||||
m.cacheMu.Unlock()
|
||||
}
|
||||
|
||||
|
|
@ -118,9 +101,6 @@ func (m *sortedMap) Put(tx *types.Transaction) {
|
|||
// provided threshold. Every removed transaction is returned for any post-removal
|
||||
// maintenance.
|
||||
func (m *sortedMap) Forward(threshold uint64) types.Transactions {
|
||||
m.m.Lock()
|
||||
defer m.m.Unlock()
|
||||
|
||||
var removed types.Transactions
|
||||
|
||||
// Pop off heap items until the threshold is reached
|
||||
|
|
@ -133,8 +113,6 @@ func (m *sortedMap) Forward(threshold uint64) types.Transactions {
|
|||
// If we had a cached order, shift the front
|
||||
m.cacheMu.Lock()
|
||||
if m.cache != nil {
|
||||
hitCacheCounter.Inc(1)
|
||||
|
||||
m.cache = m.cache[len(removed):]
|
||||
}
|
||||
m.cacheMu.Unlock()
|
||||
|
|
@ -147,9 +125,6 @@ func (m *sortedMap) Forward(threshold uint64) types.Transactions {
|
|||
// If you want to do several consecutive filterings, it's therefore better to first
|
||||
// do a .filter(func1) followed by .Filter(func2) or reheap()
|
||||
func (m *sortedMap) Filter(filter func(*types.Transaction) bool) types.Transactions {
|
||||
m.m.Lock()
|
||||
defer m.m.Unlock()
|
||||
|
||||
removed := m.filter(filter)
|
||||
// If transactions were removed, the heap and cache are ruined
|
||||
if len(removed) > 0 {
|
||||
|
|
@ -187,10 +162,7 @@ func (m *sortedMap) filter(filter func(*types.Transaction) bool) types.Transacti
|
|||
if len(removed) > 0 {
|
||||
m.cacheMu.Lock()
|
||||
m.cache = nil
|
||||
m.isEmpty = true
|
||||
m.cacheMu.Unlock()
|
||||
|
||||
resetCacheGauge.Inc(1)
|
||||
}
|
||||
|
||||
return removed
|
||||
|
|
@ -199,9 +171,6 @@ func (m *sortedMap) filter(filter func(*types.Transaction) bool) types.Transacti
|
|||
// Cap places a hard limit on the number of items, returning all transactions
|
||||
// exceeding that limit.
|
||||
func (m *sortedMap) Cap(threshold int) types.Transactions {
|
||||
m.m.Lock()
|
||||
defer m.m.Unlock()
|
||||
|
||||
// Short circuit if the number of items is under the limit
|
||||
if len(m.items) <= threshold {
|
||||
return nil
|
||||
|
|
@ -233,15 +202,11 @@ func (m *sortedMap) Cap(threshold int) types.Transactions {
|
|||
// Remove deletes a transaction from the maintained map, returning whether the
|
||||
// transaction was found.
|
||||
func (m *sortedMap) Remove(nonce uint64) bool {
|
||||
m.m.Lock()
|
||||
defer m.m.Unlock()
|
||||
|
||||
// Short circuit if no transaction is present
|
||||
_, ok := m.items[nonce]
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
|
||||
// Otherwise delete the transaction and fix the heap index
|
||||
for i := 0; i < m.index.Len(); i++ {
|
||||
if (*m.index)[i] == nonce {
|
||||
|
|
@ -250,16 +215,11 @@ func (m *sortedMap) Remove(nonce uint64) bool {
|
|||
break
|
||||
}
|
||||
}
|
||||
|
||||
delete(m.items, nonce)
|
||||
|
||||
m.cacheMu.Lock()
|
||||
m.cache = nil
|
||||
m.isEmpty = true
|
||||
m.cacheMu.Unlock()
|
||||
|
||||
resetCacheGauge.Inc(1)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
@ -271,9 +231,6 @@ func (m *sortedMap) Remove(nonce uint64) bool {
|
|||
// prevent getting into an invalid state. This is not something that should ever
|
||||
// happen but better to be self correcting than failing!
|
||||
func (m *sortedMap) Ready(start uint64) types.Transactions {
|
||||
m.m.Lock()
|
||||
defer m.m.Unlock()
|
||||
|
||||
// Short circuit if no transactions are available
|
||||
if m.index.Len() == 0 || (*m.index)[0] > start {
|
||||
return nil
|
||||
|
|
@ -290,7 +247,6 @@ func (m *sortedMap) Ready(start uint64) types.Transactions {
|
|||
|
||||
m.cacheMu.Lock()
|
||||
m.cache = nil
|
||||
m.isEmpty = true
|
||||
m.cacheMu.Unlock()
|
||||
|
||||
resetCacheGauge.Inc(1)
|
||||
|
|
@ -300,85 +256,25 @@ func (m *sortedMap) Ready(start uint64) types.Transactions {
|
|||
|
||||
// Len returns the length of the transaction map.
|
||||
func (m *sortedMap) Len() int {
|
||||
m.m.RLock()
|
||||
defer m.m.RUnlock()
|
||||
|
||||
return len(m.items)
|
||||
}
|
||||
|
||||
func (m *sortedMap) flatten() types.Transactions {
|
||||
// If the sorting was not cached yet, create and cache it
|
||||
m.cacheMu.Lock()
|
||||
defer m.cacheMu.Unlock()
|
||||
|
||||
if m.isEmpty {
|
||||
m.isEmpty = false // to simulate sync.Once
|
||||
|
||||
m.cacheMu.Unlock()
|
||||
|
||||
m.m.RLock()
|
||||
|
||||
cache := make(types.Transactions, 0, len(m.items))
|
||||
|
||||
// If the sorting was not cached yet, create and cache it
|
||||
if m.cache == nil {
|
||||
m.cache = make(types.Transactions, 0, len(m.items))
|
||||
for _, tx := range m.items {
|
||||
cache = append(cache, tx)
|
||||
m.cache = append(m.cache, tx)
|
||||
}
|
||||
|
||||
m.m.RUnlock()
|
||||
|
||||
// exclude sorting from locks
|
||||
sort.Sort(types.TxByNonce(cache))
|
||||
|
||||
m.cacheMu.Lock()
|
||||
m.cache = cache
|
||||
|
||||
reinitCacheGauge.Inc(1)
|
||||
missCacheCounter.Inc(1)
|
||||
} else {
|
||||
hitCacheCounter.Inc(1)
|
||||
sort.Sort(types.TxByNonce(m.cache))
|
||||
}
|
||||
|
||||
return m.cache
|
||||
}
|
||||
|
||||
func (m *sortedMap) lastElement() *types.Transaction {
|
||||
// If the sorting was not cached yet, create and cache it
|
||||
m.cacheMu.Lock()
|
||||
defer m.cacheMu.Unlock()
|
||||
|
||||
cache := m.cache
|
||||
|
||||
if m.isEmpty {
|
||||
m.isEmpty = false // to simulate sync.Once
|
||||
|
||||
m.cacheMu.Unlock()
|
||||
|
||||
m.m.RLock()
|
||||
cache = make(types.Transactions, 0, len(m.items))
|
||||
|
||||
for _, tx := range m.items {
|
||||
cache = append(cache, tx)
|
||||
}
|
||||
|
||||
m.m.RUnlock()
|
||||
|
||||
// exclude sorting from locks
|
||||
sort.Sort(types.TxByNonce(cache))
|
||||
|
||||
m.cacheMu.Lock()
|
||||
m.cache = cache
|
||||
|
||||
reinitCacheGauge.Inc(1)
|
||||
missCacheCounter.Inc(1)
|
||||
} else {
|
||||
hitCacheCounter.Inc(1)
|
||||
}
|
||||
|
||||
ln := len(cache)
|
||||
if ln == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
cache := m.flatten()
|
||||
return cache[len(cache)-1]
|
||||
}
|
||||
|
||||
|
|
@ -657,9 +553,8 @@ func (l *list) subTotalCost(txs []*types.Transaction) {
|
|||
// then the heap is sorted based on the effective tip based on the given base fee.
|
||||
// If baseFee is nil then the sorting is based on gasFeeCap.
|
||||
type priceHeap struct {
|
||||
baseFee *big.Int // heap should always be re-sorted after baseFee is changed
|
||||
list []*types.Transaction
|
||||
baseFeeMu sync.RWMutex
|
||||
baseFee *big.Int // heap should always be re-sorted after baseFee is changed
|
||||
list []*types.Transaction
|
||||
}
|
||||
|
||||
func (h *priceHeap) Len() int { return len(h.list) }
|
||||
|
|
@ -677,19 +572,13 @@ func (h *priceHeap) Less(i, j int) bool {
|
|||
}
|
||||
|
||||
func (h *priceHeap) cmp(a, b *types.Transaction) int {
|
||||
h.baseFeeMu.RLock()
|
||||
|
||||
if h.baseFee != nil {
|
||||
// Compare effective tips if baseFee is specified
|
||||
if c := a.EffectiveGasTipCmp(b, h.baseFee); c != 0 {
|
||||
h.baseFeeMu.RUnlock()
|
||||
|
||||
return c
|
||||
}
|
||||
}
|
||||
|
||||
h.baseFeeMu.RUnlock()
|
||||
|
||||
// Compare fee caps if baseFee is not specified or effective tips are equal
|
||||
if c := a.GasFeeCapCmp(b); c != 0 {
|
||||
return c
|
||||
|
|
@ -882,9 +771,6 @@ func (l *pricedList) Reheap() {
|
|||
// SetBaseFee updates the base fee and triggers a re-heap. Note that Removed is not
|
||||
// necessary to call right before SetBaseFee when processing a new block.
|
||||
func (l *pricedList) SetBaseFee(baseFee *big.Int) {
|
||||
l.urgent.baseFeeMu.Lock()
|
||||
l.urgent.baseFee = baseFee
|
||||
l.urgent.baseFeeMu.Unlock()
|
||||
|
||||
l.Reheap()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,10 +41,12 @@ var (
|
|||
ErrNoCurrentTx = errors.New("no current tx found in interruptCtx")
|
||||
)
|
||||
|
||||
type InterruptKeyType string
|
||||
|
||||
const (
|
||||
// These are keys for the interruptCtx
|
||||
InterruptCtxDelayKey = "delay"
|
||||
InterruptCtxOpcodeDelayKey = "opcodeDelay"
|
||||
InterruptCtxDelayKey InterruptKeyType = "delay"
|
||||
InterruptCtxOpcodeDelayKey InterruptKeyType = "opcodeDelay"
|
||||
|
||||
// InterruptedTxCacheSize is size of lru cache for interrupted txs
|
||||
InterruptedTxCacheSize = 90000
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import (
|
|||
"io"
|
||||
"math/big"
|
||||
"os"
|
||||
"sync"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/math"
|
||||
|
|
@ -68,9 +69,21 @@ type KeccakState interface {
|
|||
Read([]byte) (int, error)
|
||||
}
|
||||
|
||||
// hasherPool holds LegacyKeccak256 hashers for reuse.
|
||||
var hasherPool = sync.Pool{
|
||||
New: func() interface{} { return sha3.NewLegacyKeccak256() },
|
||||
}
|
||||
|
||||
// NewKeccakState creates a new KeccakState
|
||||
func NewKeccakState() KeccakState {
|
||||
return sha3.NewLegacyKeccak256().(KeccakState)
|
||||
return hasherPool.Get().(KeccakState)
|
||||
}
|
||||
|
||||
// PutKeccakState puts the KeccakState back into the pool.
|
||||
// The state must not be used after calling this function.
|
||||
func PutKeccakState(kh KeccakState) {
|
||||
kh.Reset()
|
||||
hasherPool.Put(kh)
|
||||
}
|
||||
|
||||
// HashData hashes the provided data using the KeccakState and returns a 32 byte hash
|
||||
|
|
@ -78,7 +91,6 @@ func HashData(kh KeccakState, data []byte) (h common.Hash) {
|
|||
kh.Reset()
|
||||
kh.Write(data)
|
||||
kh.Read(h[:])
|
||||
|
||||
return h
|
||||
}
|
||||
|
||||
|
|
@ -86,13 +98,14 @@ func HashData(kh KeccakState, data []byte) (h common.Hash) {
|
|||
func Keccak256(data ...[]byte) []byte {
|
||||
b := make([]byte, 32)
|
||||
d := NewKeccakState()
|
||||
defer PutKeccakState(d)
|
||||
d.Reset()
|
||||
|
||||
for _, b := range data {
|
||||
d.Write(b)
|
||||
}
|
||||
|
||||
d.Read(b)
|
||||
|
||||
return b
|
||||
}
|
||||
|
||||
|
|
@ -100,12 +113,14 @@ func Keccak256(data ...[]byte) []byte {
|
|||
// converting it to an internal Hash data structure.
|
||||
func Keccak256Hash(data ...[]byte) (h common.Hash) {
|
||||
d := NewKeccakState()
|
||||
defer PutKeccakState(d)
|
||||
d.Reset()
|
||||
|
||||
for _, b := range data {
|
||||
d.Write(b)
|
||||
}
|
||||
|
||||
d.Read(h[:])
|
||||
|
||||
return h
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
# This configuration file is for reference and learning purpose only.
|
||||
# The default value of the flags is provided below (except a few flags which has custom defaults which are explicitly mentioned).
|
||||
# Recommended values for mainnet and/or mumbai,amoy are also provided.
|
||||
# Recommended values for mainnet and/or amoy are also provided.
|
||||
|
||||
chain = "mainnet" # Name of the chain to sync ("amoy", "mumbai", "mainnet") or path to a genesis file
|
||||
chain = "mainnet" # Name of the chain to sync ("mainnet" or "amoy") or path to a genesis file
|
||||
identity = "Annon-Identity" # Name/Identity of the node (default = OS hostname)
|
||||
verbosity = 3 # Logging verbosity for the server (5=trace|4=debug|3=info|2=warn|1=error|0=crit) (`log-level` was replaced by `verbosity`, and thus will be deprecated soon)
|
||||
vmdebug = false # Record information useful for VM and contract debugging
|
||||
datadir = "var/lib/bor" # Path of the data directory to store information
|
||||
ancient = "" # Data directory for ancient chain segments (default = inside chaindata)
|
||||
"db.engine" = "leveldb" # Used to select leveldb or pebble as database (default = leveldb)
|
||||
"db.engine" = "pebble" # Used to select leveldb or pebble as database (default = pebble)
|
||||
"state.scheme" = "path" # Used to select the state scheme (default = path)
|
||||
keystore = "" # Path of the directory where keystores are located
|
||||
"rpc.batchlimit" = 100 # Maximum number of messages in a batch (default=100, use 0 for no limits)
|
||||
"rpc.returndatalimit" = 100000 # Maximum size (in bytes) a result of an rpc request could have (default=100000, use 0 for no limits)
|
||||
|
|
@ -152,7 +153,7 @@ devfakeauthor = false # Run miner without validator set authorization
|
|||
region = "us-north-1"
|
||||
|
||||
[cache]
|
||||
cache = 1024 # Megabytes of memory allocated to internal caching (recommended for mainnet = 4096, default suitable for amoy/mumbai/devnet)
|
||||
cache = 1024 # Megabytes of memory allocated to internal caching (recommended for mainnet = 4096, default suitable for amoy/devnet)
|
||||
gc = 25 # Percentage of cache memory allowance to use for trie pruning (default = 25% full mode, 0% archive mode)
|
||||
snapshot = 10 # Percentage of cache memory allowance to use for snapshot caching (default = 10% full mode, 20% archive mode)
|
||||
database = 50 # Percentage of cache memory allowance to use for database io
|
||||
|
|
@ -180,6 +181,11 @@ devfakeauthor = false # Run miner without validator set authorization
|
|||
period = 0 # Block period to use in developer mode (0 = mine only if transaction pending)
|
||||
gaslimit = 11500000 # Initial block gas limit
|
||||
|
||||
[parallelevm]
|
||||
enable = true # Enables parallel execution using Block STM
|
||||
procs = 8 # Number of speculative processes (cores) in Block STM
|
||||
enforce = false # Use only Block STM for execution and skip serial execution
|
||||
|
||||
[pprof]
|
||||
pprof = false # Enable the pprof HTTP server
|
||||
port = 6060 # pprof HTTP server listening port
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ The ```bor server``` command runs the Bor client.
|
|||
|
||||
- ```datadir.ancient```: Data directory for ancient chain segments (default = inside chaindata)
|
||||
|
||||
- ```db.engine```: Backing database implementation to use ('leveldb' or 'pebble') (default: leveldb)
|
||||
- ```db.engine```: Backing database implementation to use ('leveldb' or 'pebble') (default: pebble)
|
||||
|
||||
- ```dev```: Enable developer mode with ephemeral proof-of-authority network and a pre-funded developer account, mining enabled (default: false)
|
||||
|
||||
|
|
@ -66,6 +66,8 @@ The ```bor server``` command runs the Bor client.
|
|||
|
||||
- ```parallelevm.enable```: Enable Block STM (default: true)
|
||||
|
||||
- ```parallelevm.enforce```: Enforce block processing via Block STM (default: false)
|
||||
|
||||
- ```parallelevm.procs```: Number of speculative processes (cores) in Block STM (default: 8)
|
||||
|
||||
- ```pprof```: Enable the pprof HTTP server (default: false)
|
||||
|
|
@ -84,7 +86,7 @@ The ```bor server``` command runs the Bor client.
|
|||
|
||||
- ```snapshot```: Enables the snapshot-database mode (default: true)
|
||||
|
||||
- ```state.scheme```: Scheme to use for storing ethereum state ('hash' or 'path') (default: hash)
|
||||
- ```state.scheme```: Scheme to use for storing ethereum state ('hash' or 'path') (default: path)
|
||||
|
||||
- ```syncmode```: Blockchain sync mode (only "full" sync supported) (default: full)
|
||||
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
|
|||
// check if Parallel EVM is enabled
|
||||
// if enabled, use parallel state processor
|
||||
if config.ParallelEVM.Enable {
|
||||
eth.blockchain, err = core.NewParallelBlockChain(chainDb, cacheConfig, config.Genesis, &overrides, eth.engine, vmConfig, eth.shouldPreserve, &config.TxLookupLimit, checker, config.ParallelEVM.SpeculativeProcesses)
|
||||
eth.blockchain, err = core.NewParallelBlockChain(chainDb, cacheConfig, config.Genesis, &overrides, eth.engine, vmConfig, eth.shouldPreserve, &config.TxLookupLimit, checker, config.ParallelEVM.SpeculativeProcesses, config.ParallelEVM.Enforce)
|
||||
} else {
|
||||
eth.blockchain, err = core.NewBlockChain(chainDb, cacheConfig, config.Genesis, &overrides, eth.engine, vmConfig, eth.shouldPreserve, &config.TxLookupLimit, checker)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -559,7 +559,7 @@ func TestIsValidChain(t *testing.T) {
|
|||
s.ProcessMilestone(tempChain[1].Number.Uint64(), tempChain[1].Hash())
|
||||
|
||||
// case10: Try importing a past chain having valid checkpoint, should
|
||||
// consider the chain as invalid as still lastest milestone is ahead of the chain.
|
||||
// consider the chain as invalid as still latest milestone is ahead of the chain.
|
||||
res, err = s.IsValidChain(tempChain[1], chainA)
|
||||
require.Nil(t, err)
|
||||
require.Equal(t, res, false, "expected chain to be invalid")
|
||||
|
|
|
|||
|
|
@ -478,7 +478,7 @@ func formatLogs(logs []StructLog) []StructLogRes {
|
|||
|
||||
formatted[index].Stack = &stack
|
||||
}
|
||||
if trace.ReturnData != nil && len(trace.ReturnData) > 0 {
|
||||
if len(trace.ReturnData) > 0 {
|
||||
formatted[index].ReturnData = hexutil.Bytes(trace.ReturnData).String()
|
||||
}
|
||||
if trace.Memory != nil {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@ import (
|
|||
"github.com/ethereum/go-ethereum/core/types"
|
||||
)
|
||||
|
||||
const (
|
||||
zeroAddress = "0x0000000000000000000000000000000000000000"
|
||||
)
|
||||
|
||||
// GetRootHash returns the merkle root of the block headers
|
||||
func (ec *Client) GetRootHash(ctx context.Context, startBlockNumber uint64, endBlockNumber uint64) (string, error) {
|
||||
var rootHash string
|
||||
|
|
|
|||
|
|
@ -163,7 +163,13 @@ func (ec *Client) getBlock(ctx context.Context, method string, args ...interface
|
|||
return nil, errors.New("server returned empty uncle list but block header indicates uncles")
|
||||
}
|
||||
if head.TxHash == types.EmptyTxsHash && len(body.Transactions) > 0 {
|
||||
return nil, errors.New("server returned non-empty transaction list but block header indicates no transactions")
|
||||
// If there is only one transaction in the block and the header's txHash is `EmptyTxsHash`,
|
||||
// it indicates a state-sync transaction. No error handling is required in this case.
|
||||
tx := body.Transactions[0]
|
||||
if (tx.From != nil && *tx.From != common.HexToAddress(zeroAddress)) ||
|
||||
(tx.tx.To() != nil && *tx.tx.To() != common.HexToAddress(zeroAddress)) {
|
||||
return nil, errors.New("server returned non-empty transaction list but block header indicates no transactions")
|
||||
}
|
||||
}
|
||||
if head.TxHash != types.EmptyTxsHash && len(body.Transactions) == 0 {
|
||||
return nil, errors.New("server returned empty transaction list but block header indicates transactions")
|
||||
|
|
|
|||
12
go.mod
12
go.mod
|
|
@ -1,8 +1,6 @@
|
|||
module github.com/ethereum/go-ethereum
|
||||
|
||||
go 1.22
|
||||
|
||||
toolchain go1.22.1
|
||||
go 1.23.6
|
||||
|
||||
require (
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.2
|
||||
|
|
@ -174,7 +172,7 @@ require (
|
|||
github.com/tklauser/numcpus v0.6.0 // indirect
|
||||
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
|
||||
golang.org/x/mod v0.18.0 // indirect
|
||||
golang.org/x/net v0.26.0 // indirect
|
||||
golang.org/x/net v0.33.0 // indirect
|
||||
google.golang.org/protobuf v1.34.1
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gotest.tools v2.2.0+incompatible
|
||||
|
|
@ -223,7 +221,7 @@ require (
|
|||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.0 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/huandu/xstrings v1.3.2 // indirect
|
||||
|
|
@ -288,7 +286,7 @@ require (
|
|||
go.opentelemetry.io/otel/trace v1.27.0
|
||||
go.opentelemetry.io/proto/otlp v1.2.0 // indirect
|
||||
google.golang.org/api v0.169.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect
|
||||
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
|
||||
)
|
||||
|
||||
replace github.com/cosmos/cosmos-sdk => github.com/maticnetwork/cosmos-sdk v0.38.4
|
||||
|
|
@ -297,7 +295,7 @@ replace github.com/tendermint/tendermint => github.com/maticnetwork/tendermint v
|
|||
|
||||
replace github.com/tendermint/tm-db => github.com/tendermint/tm-db v0.2.0
|
||||
|
||||
replace github.com/ethereum/go-ethereum => github.com/maticnetwork/bor v1.3.2
|
||||
replace github.com/ethereum/go-ethereum => github.com/maticnetwork/bor v1.5.5
|
||||
|
||||
replace github.com/Masterminds/goutils => github.com/Masterminds/goutils v1.1.1
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ func TestCommand_DebugBlock(t *testing.T) {
|
|||
|
||||
// enable archive mode for getting traces of ancient blocks
|
||||
config.GcMode = "archive"
|
||||
config.StateScheme = "hash"
|
||||
|
||||
// start the mock server
|
||||
srv, err := server.CreateMockServer(config)
|
||||
|
|
|
|||
|
|
@ -378,7 +378,7 @@ func (i *SliceStringFlag) UpdateValue(value string) {
|
|||
}
|
||||
|
||||
func (f *Flagset) SliceStringFlag(s *SliceStringFlag) {
|
||||
if s.Default == nil || len(s.Default) == 0 {
|
||||
if len(s.Default) == 0 {
|
||||
f.addFlag(&FlagVar{
|
||||
Name: s.Name,
|
||||
Usage: s.Usage,
|
||||
|
|
@ -482,7 +482,7 @@ func (m *MapStringFlag) UpdateValue(value string) {
|
|||
}
|
||||
|
||||
func (f *Flagset) MapStringFlag(m *MapStringFlag) {
|
||||
if m.Default == nil || len(m.Default) == 0 {
|
||||
if len(m.Default) == 0 {
|
||||
f.addFlag(&FlagVar{
|
||||
Name: m.Name,
|
||||
Usage: m.Usage,
|
||||
|
|
|
|||
|
|
@ -597,6 +597,8 @@ type ParallelEVMConfig struct {
|
|||
Enable bool `hcl:"enable,optional" toml:"enable,optional"`
|
||||
|
||||
SpeculativeProcesses int `hcl:"procs,optional" toml:"procs,optional"`
|
||||
|
||||
Enforce bool `hcl:"enforce,optional" toml:"enforce,optional"`
|
||||
}
|
||||
|
||||
func DefaultConfig() *Config {
|
||||
|
|
@ -609,7 +611,7 @@ func DefaultConfig() *Config {
|
|||
EnablePreimageRecording: false,
|
||||
DataDir: DefaultDataDir(),
|
||||
Ancient: "",
|
||||
DBEngine: "leveldb",
|
||||
DBEngine: "pebble",
|
||||
KeyStoreDir: "",
|
||||
Logging: &LoggingConfig{
|
||||
Vmodule: "",
|
||||
|
|
@ -647,7 +649,7 @@ func DefaultConfig() *Config {
|
|||
},
|
||||
SyncMode: "full",
|
||||
GcMode: "full",
|
||||
StateScheme: "hash",
|
||||
StateScheme: "path",
|
||||
Snapshot: true,
|
||||
BorLogs: false,
|
||||
TxPool: &TxPoolConfig{
|
||||
|
|
@ -794,6 +796,7 @@ func DefaultConfig() *Config {
|
|||
ParallelEVM: &ParallelEVMConfig{
|
||||
Enable: true,
|
||||
SpeculativeProcesses: 8,
|
||||
Enforce: false,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
@ -1168,6 +1171,9 @@ func (c *Config) buildEth(stack *node.Node, accountManager *accounts.Manager) (*
|
|||
|
||||
log.Info("Enabling recording of key preimages since archive mode is used")
|
||||
}
|
||||
if c.StateScheme == "path" {
|
||||
return nil, fmt.Errorf("path storage scheme is not supported in archive mode, please use hash instead")
|
||||
}
|
||||
default:
|
||||
return nil, fmt.Errorf("gcmode '%s' not found", c.GcMode)
|
||||
}
|
||||
|
|
@ -1196,6 +1202,7 @@ func (c *Config) buildEth(stack *node.Node, accountManager *accounts.Manager) (*
|
|||
|
||||
n.ParallelEVM.Enable = c.ParallelEVM.Enable
|
||||
n.ParallelEVM.SpeculativeProcesses = c.ParallelEVM.SpeculativeProcesses
|
||||
n.ParallelEVM.Enforce = c.ParallelEVM.Enforce
|
||||
n.RPCReturnDataLimit = c.RPCReturnDataLimit
|
||||
|
||||
if c.Ancient != "" {
|
||||
|
|
|
|||
|
|
@ -144,3 +144,17 @@ func TestMakePasswordListFromFile(t *testing.T) {
|
|||
assert.Equal(t, []string{"test1", "test2"}, result)
|
||||
})
|
||||
}
|
||||
|
||||
func TestConfigStateScheme(t *testing.T) {
|
||||
config := DefaultConfig()
|
||||
config.StateScheme = "path"
|
||||
config.GcMode = "archive"
|
||||
|
||||
assert.NoError(t, config.loadChain())
|
||||
|
||||
_, err := config.buildNode()
|
||||
assert.NoError(t, err)
|
||||
|
||||
_, err = config.buildEth(nil, nil)
|
||||
assert.Error(t, err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -986,6 +986,13 @@ func (c *Command) Flags(config *Config) *flagset.Flagset {
|
|||
Value: &c.cliConfig.ParallelEVM.SpeculativeProcesses,
|
||||
Default: c.cliConfig.ParallelEVM.SpeculativeProcesses,
|
||||
})
|
||||
f.BoolFlag(&flagset.BoolFlag{
|
||||
Name: "parallelevm.enforce",
|
||||
Usage: "Enforce block processing via Block STM",
|
||||
Value: &c.cliConfig.ParallelEVM.Enforce,
|
||||
Default: c.cliConfig.ParallelEVM.Enforce,
|
||||
})
|
||||
|
||||
f.Uint64Flag(&flagset.Uint64Flag{
|
||||
Name: "dev.gaslimit",
|
||||
Usage: "Initial block gas limit",
|
||||
|
|
|
|||
4
internal/cli/server/testdata/default.toml
vendored
4
internal/cli/server/testdata/default.toml
vendored
|
|
@ -5,7 +5,8 @@ log-level = ""
|
|||
vmdebug = false
|
||||
datadir = "/var/lib/bor"
|
||||
ancient = ""
|
||||
"db.engine" = "leveldb"
|
||||
"db.engine" = "pebble"
|
||||
"db.scheme" = "path"
|
||||
keystore = ""
|
||||
"rpc.batchlimit" = 100
|
||||
"rpc.returndatalimit" = 100000
|
||||
|
|
@ -184,6 +185,7 @@ devfakeauthor = false
|
|||
[parallelevm]
|
||||
enable = true
|
||||
procs = 8
|
||||
enforce = false
|
||||
|
||||
[pprof]
|
||||
pprof = false
|
||||
|
|
|
|||
|
|
@ -473,7 +473,7 @@ func checkDeletePermissions(path string) (bool, error) {
|
|||
func (c *PruneBlockCommand) pruneBlock(stack *node.Node, fdHandles int) error {
|
||||
name := "chaindata"
|
||||
|
||||
oldAncientPath := c.datadirAncient
|
||||
oldAncientPath := strings.TrimSuffix(c.datadirAncient, "/")
|
||||
|
||||
switch {
|
||||
case oldAncientPath == "":
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import (
|
|||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/tyler-smith/go-bip39"
|
||||
|
||||
"github.com/ethereum/go-ethereum"
|
||||
"github.com/ethereum/go-ethereum/accounts"
|
||||
"github.com/ethereum/go-ethereum/accounts/keystore"
|
||||
"github.com/ethereum/go-ethereum/accounts/scwallet"
|
||||
|
|
@ -704,7 +705,10 @@ func (api *BlockChainAPI) GetTransactionReceiptsByBlock(ctx context.Context, blo
|
|||
|
||||
var txHash common.Hash
|
||||
|
||||
borReceipt := rawdb.ReadBorReceipt(api.b.ChainDb(), block.Hash(), block.NumberU64(), api.b.ChainConfig())
|
||||
borReceipt, err := api.b.GetBorBlockReceipt(ctx, block.Hash())
|
||||
if err != nil && err != ethereum.NotFound {
|
||||
return nil, err
|
||||
}
|
||||
if borReceipt != nil {
|
||||
receipts = append(receipts, borReceipt)
|
||||
|
||||
|
|
@ -1115,7 +1119,10 @@ func (api *BlockChainAPI) GetBlockReceipts(ctx context.Context, blockNrOrHash rp
|
|||
result[i] = marshalReceipt(receipt, block.Hash(), block.NumberU64(), signer, txs[i], i, false)
|
||||
}
|
||||
|
||||
stateSyncReceipt := rawdb.ReadBorReceipt(api.b.ChainDb(), block.Hash(), block.NumberU64(), api.b.ChainConfig())
|
||||
stateSyncReceipt, err := api.b.GetBorBlockReceipt(ctx, block.Hash())
|
||||
if err != nil && err != ethereum.NotFound {
|
||||
return nil, err
|
||||
}
|
||||
if stateSyncReceipt != nil {
|
||||
tx, _, _, _ := rawdb.ReadBorTransaction(api.b.ChainDb(), stateSyncReceipt.TxHash)
|
||||
result = append(result, marshalReceipt(stateSyncReceipt, block.Hash(), block.NumberU64(), signer, tx, len(result), true))
|
||||
|
|
@ -1901,7 +1908,7 @@ func (api *TransactionAPI) getAllBlockTransactions(ctx context.Context, block *t
|
|||
|
||||
stateSyncPresent := false
|
||||
|
||||
borReceipt := rawdb.ReadBorReceipt(api.b.ChainDb(), block.Hash(), block.NumberU64(), api.b.ChainConfig())
|
||||
borReceipt, _ := api.b.GetBorBlockReceipt(ctx, block.Hash())
|
||||
if borReceipt != nil {
|
||||
txHash := types.GetDerivedBorTxHash(types.BorReceiptKey(block.Number().Uint64(), block.Hash()))
|
||||
if txHash != (common.Hash{}) {
|
||||
|
|
@ -2074,7 +2081,10 @@ func (api *TransactionAPI) GetTransactionReceipt(ctx context.Context, hash commo
|
|||
}
|
||||
|
||||
if !found {
|
||||
tx, blockHash, blockNumber, index = rawdb.ReadBorTransaction(api.b.ChainDb(), hash)
|
||||
tx, blockHash, blockNumber, index, err = api.b.GetBorBlockTransaction(ctx, hash)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
borTx = true
|
||||
}
|
||||
|
||||
|
|
@ -2086,7 +2096,10 @@ func (api *TransactionAPI) GetTransactionReceipt(ctx context.Context, hash commo
|
|||
|
||||
if borTx {
|
||||
// Fetch bor block receipt
|
||||
receipt = rawdb.ReadBorReceipt(api.b.ChainDb(), blockHash, blockNumber, api.b.ChainConfig())
|
||||
receipt, err = api.b.GetBorBlockReceipt(ctx, blockHash)
|
||||
if err != nil && err != ethereum.NotFound {
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
receipts, err := api.b.GetReceipts(ctx, blockHash)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -587,10 +587,16 @@ func (b testBackend) SendTx(ctx context.Context, signedTx *types.Transaction) er
|
|||
}
|
||||
func (b testBackend) GetTransaction(ctx context.Context, txHash common.Hash) (bool, *types.Transaction, common.Hash, uint64, uint64, error) {
|
||||
tx, blockHash, blockNumber, index := rawdb.ReadTransaction(b.db, txHash)
|
||||
return true, tx, blockHash, blockNumber, index, nil
|
||||
found := true
|
||||
if tx == nil {
|
||||
found = false
|
||||
}
|
||||
return found, tx, blockHash, blockNumber, index, nil
|
||||
}
|
||||
func (b testBackend) GetPoolTransactions() (types.Transactions, error) { panic("implement me") }
|
||||
func (b testBackend) GetPoolTransaction(txHash common.Hash) *types.Transaction {
|
||||
return nil
|
||||
}
|
||||
func (b testBackend) GetPoolTransactions() (types.Transactions, error) { panic("implement me") }
|
||||
func (b testBackend) GetPoolTransaction(txHash common.Hash) *types.Transaction { panic("implement me") }
|
||||
func (b testBackend) GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error) {
|
||||
return 0, nil
|
||||
}
|
||||
|
|
@ -625,7 +631,8 @@ func (b testBackend) ServiceFilter(ctx context.Context, session *bloombits.Match
|
|||
|
||||
// GetBorBlockTransaction returns bor block tx
|
||||
func (b testBackend) GetBorBlockTransaction(ctx context.Context, hash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error) {
|
||||
panic("implement me")
|
||||
tx, blockHash, blockNumber, index := rawdb.ReadBorTransaction(b.ChainDb(), hash)
|
||||
return tx, blockHash, blockNumber, index, nil
|
||||
}
|
||||
|
||||
func (b testBackend) GetBorBlockTransactionWithBlockHash(ctx context.Context, txHash common.Hash, blockHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error) {
|
||||
|
|
@ -683,14 +690,9 @@ func (b testBackend) GetBorBlockLogs(ctx context.Context, hash common.Hash) ([]*
|
|||
}
|
||||
|
||||
func (b testBackend) GetBorBlockReceipt(ctx context.Context, hash common.Hash) (*types.Receipt, error) {
|
||||
number := rawdb.ReadHeaderNumber(b.db, hash)
|
||||
if number == nil {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
receipt := rawdb.ReadRawBorReceipt(b.db, hash, *number)
|
||||
receipt := b.chain.GetBorReceiptByHash(hash)
|
||||
if receipt == nil {
|
||||
return nil, nil
|
||||
return nil, ethereum.NotFound
|
||||
}
|
||||
|
||||
return receipt, nil
|
||||
|
|
@ -1902,9 +1904,12 @@ func TestRPCGetBlockOrHeader(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func setupReceiptBackend(t *testing.T, genBlocks int) (*testBackend, []common.Hash) {
|
||||
func setupTransactionsToApiTest(t *testing.T) (*TransactionAPI, []common.Hash, []struct {
|
||||
txHash common.Hash
|
||||
file string
|
||||
}) {
|
||||
config := *params.TestChainConfig
|
||||
|
||||
genBlocks := 5
|
||||
config.ShanghaiBlock = big.NewInt(0)
|
||||
config.CancunBlock = big.NewInt(0)
|
||||
|
||||
|
|
@ -1935,7 +1940,7 @@ func setupReceiptBackend(t *testing.T, genBlocks int) (*testBackend, []common.Ha
|
|||
},
|
||||
}
|
||||
signer = types.LatestSignerForChainID(params.TestChainConfig.ChainID)
|
||||
txHashes = make([]common.Hash, genBlocks)
|
||||
txHashes = make([]common.Hash, genBlocks+1)
|
||||
)
|
||||
|
||||
// Set the terminal total difficulty in the config
|
||||
|
|
@ -1974,20 +1979,6 @@ func setupReceiptBackend(t *testing.T, genBlocks int) (*testBackend, []common.Ha
|
|||
StorageKeys: []common.Hash{{0}},
|
||||
}}
|
||||
tx, err = types.SignTx(types.NewTx(&types.AccessListTx{Nonce: uint64(i), To: nil, Gas: 58100, GasPrice: b.BaseFee(), Data: common.FromHex("0x60806040"), AccessList: accessList}), signer, acc1Key)
|
||||
case 5:
|
||||
// blob tx
|
||||
fee := big.NewInt(500)
|
||||
fee.Add(fee, b.BaseFee())
|
||||
tx, err = types.SignTx(types.NewTx(&types.BlobTx{
|
||||
Nonce: uint64(i),
|
||||
GasTipCap: uint256.NewInt(1),
|
||||
GasFeeCap: uint256.MustFromBig(fee),
|
||||
Gas: params.TxGas,
|
||||
To: acc2Addr,
|
||||
BlobFeeCap: uint256.NewInt(1),
|
||||
BlobHashes: []common.Hash{{1}},
|
||||
Value: new(uint256.Int),
|
||||
}), signer, acc1Key)
|
||||
}
|
||||
if err != nil {
|
||||
t.Errorf("failed to sign tx: %v", err)
|
||||
|
|
@ -1997,16 +1988,8 @@ func setupReceiptBackend(t *testing.T, genBlocks int) (*testBackend, []common.Ha
|
|||
txHashes[i] = tx.Hash()
|
||||
}
|
||||
})
|
||||
return backend, txHashes
|
||||
}
|
||||
|
||||
func TestRPCGetTransactionReceipt(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
var (
|
||||
backend, txHashes = setupReceiptBackend(t, 6)
|
||||
api = NewTransactionAPI(backend, new(AddrLocker))
|
||||
)
|
||||
txHashes[genBlocks] = mockStateSyncTxOnCurrentBlock(t, backend)
|
||||
|
||||
var testSuite = []struct {
|
||||
txHash common.Hash
|
||||
|
|
@ -2047,12 +2030,45 @@ func TestRPCGetTransactionReceipt(t *testing.T) {
|
|||
txHash: common.HexToHash("deadbeef"),
|
||||
file: "txhash-notfound",
|
||||
},
|
||||
// 7. blob tx
|
||||
// 7. state sync tx found
|
||||
{
|
||||
txHash: txHashes[5],
|
||||
file: "blob-tx",
|
||||
file: "state-sync-tx",
|
||||
},
|
||||
}
|
||||
// map sprint 0 to block 6
|
||||
backend.ChainConfig().Bor.Sprint["0"] = uint64(genBlocks)
|
||||
|
||||
api := NewTransactionAPI(backend, new(AddrLocker))
|
||||
|
||||
return api, txHashes, testSuite
|
||||
}
|
||||
|
||||
func mockStateSyncTxOnCurrentBlock(t *testing.T, backend *testBackend) common.Hash {
|
||||
// State Sync Tx Setup
|
||||
var stateSyncLogs []*types.Log
|
||||
block, err := backend.BlockByHash(context.Background(), backend.CurrentBlock().Hash())
|
||||
if err != nil {
|
||||
t.Errorf("failed to get current block: %v", err)
|
||||
}
|
||||
|
||||
types.DeriveFieldsForBorLogs(stateSyncLogs, block.Hash(), block.NumberU64(), 0, 0)
|
||||
|
||||
// Write bor receipt
|
||||
rawdb.WriteBorReceipt(backend.ChainDb(), block.Hash(), block.NumberU64(), &types.ReceiptForStorage{
|
||||
Status: types.ReceiptStatusSuccessful, // make receipt status successful
|
||||
Logs: stateSyncLogs,
|
||||
})
|
||||
|
||||
// Write bor tx reverse lookup
|
||||
rawdb.WriteBorTxLookupEntry(backend.ChainDb(), block.Hash(), block.NumberU64())
|
||||
return types.GetDerivedBorTxHash(types.BorReceiptKey(block.NumberU64(), block.Hash()))
|
||||
}
|
||||
|
||||
func TestRPCGetTransactionReceipt(t *testing.T) {
|
||||
var (
|
||||
api, _, testSuite = setupTransactionsToApiTest(t)
|
||||
)
|
||||
|
||||
for i, tt := range testSuite {
|
||||
var (
|
||||
|
|
@ -2067,6 +2083,48 @@ func TestRPCGetTransactionReceipt(t *testing.T) {
|
|||
testRPCResponseWithFile(t, i, result, "eth_getTransactionReceipt", tt.file)
|
||||
}
|
||||
}
|
||||
func TestRPCGetTransactionByHash(t *testing.T) {
|
||||
var (
|
||||
api, _, testSuite = setupTransactionsToApiTest(t)
|
||||
)
|
||||
|
||||
for i, tt := range testSuite {
|
||||
var (
|
||||
result interface{}
|
||||
err error
|
||||
)
|
||||
result, err = api.GetTransactionByHash(context.Background(), tt.txHash)
|
||||
if err != nil {
|
||||
t.Errorf("test %d: want no error, have %v", i, err)
|
||||
continue
|
||||
}
|
||||
testRPCResponseWithFile(t, i, result, "eth_getTransactionByHash", tt.file)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRPCGetBlockTransactionCountByHash(t *testing.T) {
|
||||
var (
|
||||
api, _, _ = setupTransactionsToApiTest(t)
|
||||
)
|
||||
|
||||
cnt := api.GetBlockTransactionCountByHash(context.Background(), api.b.CurrentBlock().Hash())
|
||||
|
||||
// 2 txs: create-contract-with-access-list + state sync tx
|
||||
expected := hexutil.Uint(2)
|
||||
require.Equal(t, expected, *cnt)
|
||||
}
|
||||
|
||||
func TestRPCGetTransactionByBlockHashAndIndex(t *testing.T) {
|
||||
var (
|
||||
api, _, _ = setupTransactionsToApiTest(t)
|
||||
)
|
||||
|
||||
createContractWithAccessList := api.GetTransactionByBlockHashAndIndex(context.Background(), api.b.CurrentBlock().Hash(), 0)
|
||||
stateSyncTx := api.GetTransactionByBlockHashAndIndex(context.Background(), api.b.CurrentBlock().Hash(), 1)
|
||||
|
||||
testRPCResponseWithFile(t, 0, createContractWithAccessList, "eth_getTransactionByBlockHashAndIndex", "create-contract-with-access-list")
|
||||
testRPCResponseWithFile(t, 1, stateSyncTx, "eth_getTransactionByBlockHashAndIndex", "state-sync-tx")
|
||||
}
|
||||
|
||||
func testRPCResponseWithFile(t *testing.T, testid int, result interface{}, rpc string, file string) {
|
||||
data, err := json.MarshalIndent(result, "", " ")
|
||||
|
|
@ -2086,8 +2144,47 @@ func testRPCResponseWithFile(t *testing.T, testid int, result interface{}, rpc s
|
|||
}
|
||||
|
||||
func TestRPCGetTransactionReceiptsByBlock(t *testing.T) {
|
||||
t.Parallel()
|
||||
api, blockNrOrHash, testSuite := setupBlocksToApiTest(t)
|
||||
|
||||
receipts, err := api.GetTransactionReceiptsByBlock(context.Background(), blockNrOrHash)
|
||||
if err != nil {
|
||||
t.Fatal("api error")
|
||||
}
|
||||
|
||||
for i, tt := range testSuite {
|
||||
data, err := json.Marshal(receipts[i])
|
||||
if err != nil {
|
||||
t.Errorf("test %d: json marshal error", i)
|
||||
continue
|
||||
}
|
||||
want, have := tt.want, string(data)
|
||||
require.JSONEqf(t, want, have, "test %d: json not match, want: %s, have: %s", i, want, have)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRPCGetBlockReceipts(t *testing.T) {
|
||||
api, blockNrOrHash, testSuite := setupBlocksToApiTest(t)
|
||||
|
||||
receipts, err := api.GetBlockReceipts(context.Background(), blockNrOrHash)
|
||||
if err != nil {
|
||||
t.Fatal("api error")
|
||||
}
|
||||
|
||||
for i, tt := range testSuite {
|
||||
data, err := json.Marshal(receipts[i])
|
||||
if err != nil {
|
||||
t.Errorf("test %d: json marshal error", i)
|
||||
continue
|
||||
}
|
||||
want, have := tt.want, string(data)
|
||||
require.JSONEqf(t, want, have, "test %d: json not match, want: %s, have: %s", i, want, have)
|
||||
}
|
||||
}
|
||||
|
||||
func setupBlocksToApiTest(t *testing.T) (*BlockChainAPI, rpc.BlockNumberOrHash, []struct {
|
||||
txHash common.Hash
|
||||
want string
|
||||
}) {
|
||||
// Initialize test accounts
|
||||
var (
|
||||
acc1Key, _ = crypto.HexToECDSA("8a1f9a8f95be41cd7ccb6168179afb4504aefe388d1e14474d32c45c72ce7b7a")
|
||||
|
|
@ -2103,7 +2200,7 @@ func TestRPCGetTransactionReceiptsByBlock(t *testing.T) {
|
|||
contract: {Balance: big.NewInt(params.Ether), Code: common.FromHex("0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063a9059cbb14610030575b600080fd5b61004a6004803603810190610045919061016a565b610060565b60405161005791906101c5565b60405180910390f35b60008273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516100bf91906101ef565b60405180910390a36001905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610101826100d6565b9050919050565b610111816100f6565b811461011c57600080fd5b50565b60008135905061012e81610108565b92915050565b6000819050919050565b61014781610134565b811461015257600080fd5b50565b6000813590506101648161013e565b92915050565b60008060408385031215610181576101806100d1565b5b600061018f8582860161011f565b92505060206101a085828601610155565b9150509250929050565b60008115159050919050565b6101bf816101aa565b82525050565b60006020820190506101da60008301846101b6565b92915050565b6101e981610134565b82525050565b600060208201905061020460008301846101e0565b9291505056fea2646970667358221220b469033f4b77b9565ee84e0a2f04d496b18160d26034d54f9487e57788fd36d564736f6c63430008120033")},
|
||||
},
|
||||
}
|
||||
genTxs = 5
|
||||
genTxs = 6
|
||||
genBlocks = 1
|
||||
signer = types.LatestSignerForChainID(params.TestChainConfig.ChainID)
|
||||
txHashes = make([]common.Hash, 0, genTxs)
|
||||
|
|
@ -2149,6 +2246,11 @@ func TestRPCGetTransactionReceiptsByBlock(t *testing.T) {
|
|||
}
|
||||
})
|
||||
|
||||
txHashes = append(txHashes, mockStateSyncTxOnCurrentBlock(t, backend))
|
||||
|
||||
// map sprint 0 to block 1
|
||||
backend.ChainConfig().Bor.Sprint["0"] = 1
|
||||
|
||||
api := NewBlockChainAPI(backend)
|
||||
blockHashes := make([]common.Hash, genBlocks+1)
|
||||
ctx := context.Background()
|
||||
|
|
@ -2315,20 +2417,27 @@ func TestRPCGetTransactionReceiptsByBlock(t *testing.T) {
|
|||
"type": "0x1"
|
||||
}`,
|
||||
},
|
||||
// 5. state sync tx
|
||||
{
|
||||
txHash: txHashes[5],
|
||||
want: `{
|
||||
"blockHash": "0x1728b788dfe51e507d25f14f01414b5a17f807953c13833811d2afae1982b53b",
|
||||
"blockNumber": "0x1",
|
||||
"contractAddress": null,
|
||||
"cumulativeGasUsed": "0x0",
|
||||
"effectiveGasPrice": "0x0",
|
||||
"from": "0x0000000000000000000000000000000000000000",
|
||||
"gasUsed": "0x0",
|
||||
"logs": [],
|
||||
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
||||
"status": "0x1",
|
||||
"to": "0x0000000000000000000000000000000000000000",
|
||||
"transactionHash": "0xba46f68d5c3729ac3fb672fec579fc2cad543bc9edf5b2d47d7c6636ac2fbec9",
|
||||
"transactionIndex": "0x5",
|
||||
"type": "0x0"
|
||||
}`,
|
||||
},
|
||||
}
|
||||
|
||||
receipts, err := api.GetTransactionReceiptsByBlock(context.Background(), blockNrOrHash)
|
||||
if err != nil {
|
||||
t.Fatal("api error")
|
||||
}
|
||||
|
||||
for i, tt := range testSuite {
|
||||
data, err := json.Marshal(receipts[i])
|
||||
if err != nil {
|
||||
t.Errorf("test %d: json marshal error", i)
|
||||
continue
|
||||
}
|
||||
want, have := tt.want, string(data)
|
||||
require.JSONEqf(t, want, have, "test %d: json not match, want: %s, have: %s", i, want, have)
|
||||
}
|
||||
return api, blockNrOrHash, testSuite
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +0,0 @@
|
|||
[
|
||||
{
|
||||
"blobGasPrice": null,
|
||||
"blobGasUsed": "0x20000",
|
||||
"blockHash": "0x4446b1498499cab37cfec330097fadf285c703444d431756940528d32fe0e97b",
|
||||
"blockNumber": "0x6",
|
||||
"contractAddress": null,
|
||||
"cumulativeGasUsed": "0x5208",
|
||||
"effectiveGasPrice": "0x1b09d63b",
|
||||
"from": "0x703c4b2bd70c169f5717101caee543299fc946c7",
|
||||
"gasUsed": "0x5208",
|
||||
"logs": [{"address": "0x0000000000000000000000000000000000001010", "blockHash": "0x4446b1498499cab37cfec330097fadf285c703444d431756940528d32fe0e97b", "blockNumber": "0x6", "data": "0x00000000000000000000000000000000000000000000000000000000000052080000000000000000000000000000000000000000000000000de04bce435b746d0000000000000000000000000000000000000000000000000000000000a32f640000000000000000000000000000000000000000000000000de04bce435b22650000000000000000000000000000000000000000000000000000000000a3816c", "logIndex": "0x0", "removed": false, "topics": ["0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", "0x000000000000000000000000703c4b2bd70c169f5717101caee543299fc946c7", "0x0000000000000000000000000000000000000000000000000000000000000000"], "transactionHash": "0xb51ee3d2a89ba5d5623c73133c8d7a6ba9fb41194c17f4302c21b30994a1180f", "transactionIndex": "0x0"}],
|
||||
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000020000000000000020000000000000000000800000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000004000000000000000000001800000000000000000000000000000100000000020000000000000000000000000000000000000000020000000000000000000100000",
|
||||
"status": "0x1",
|
||||
"to": "0x0d3ab14bbad3d99f4203bd7a11acb94882050e7e",
|
||||
"transactionHash": "0xb51ee3d2a89ba5d5623c73133c8d7a6ba9fb41194c17f4302c21b30994a1180f",
|
||||
"transactionIndex": "0x0",
|
||||
"type": "0x3"
|
||||
}
|
||||
]
|
||||
|
|
@ -2,14 +2,14 @@
|
|||
{
|
||||
"blobGasPrice": null,
|
||||
"blobGasUsed": "0x20000",
|
||||
"blockHash": "0x4446b1498499cab37cfec330097fadf285c703444d431756940528d32fe0e97b",
|
||||
"blockHash": "0x4d780246cde52e535f40603d47af8fa1aea807dd3065e1acd97127bea0922b3e",
|
||||
"blockNumber": "0x6",
|
||||
"contractAddress": null,
|
||||
"cumulativeGasUsed": "0x5208",
|
||||
"effectiveGasPrice": "0x1b09d63b",
|
||||
"from": "0x703c4b2bd70c169f5717101caee543299fc946c7",
|
||||
"gasUsed": "0x5208",
|
||||
"logs": [{"address": "0x0000000000000000000000000000000000001010", "blockHash": "0x4446b1498499cab37cfec330097fadf285c703444d431756940528d32fe0e97b", "blockNumber": "0x6", "data": "0x00000000000000000000000000000000000000000000000000000000000052080000000000000000000000000000000000000000000000000de04bce435b746d0000000000000000000000000000000000000000000000000000000000a32f640000000000000000000000000000000000000000000000000de04bce435b22650000000000000000000000000000000000000000000000000000000000a3816c", "logIndex": "0x0", "removed": false, "topics": ["0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", "0x000000000000000000000000703c4b2bd70c169f5717101caee543299fc946c7", "0x0000000000000000000000000000000000000000000000000000000000000000"], "transactionHash": "0xb51ee3d2a89ba5d5623c73133c8d7a6ba9fb41194c17f4302c21b30994a1180f", "transactionIndex": "0x0"}],
|
||||
"logs": [{"address": "0x0000000000000000000000000000000000001010", "blockHash": "0x4d780246cde52e535f40603d47af8fa1aea807dd3065e1acd97127bea0922b3e", "blockNumber": "0x6", "data": "0x00000000000000000000000000000000000000000000000000000000000052080000000000000000000000000000000000000000000000000de04bce435b746d0000000000000000000000000000000000000000000000000000000000a32f640000000000000000000000000000000000000000000000000de04bce435b22650000000000000000000000000000000000000000000000000000000000a3816c", "logIndex": "0x0", "removed": false, "topics": ["0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", "0x000000000000000000000000703c4b2bd70c169f5717101caee543299fc946c7", "0x0000000000000000000000000000000000000000000000000000000000000000"], "transactionHash": "0xb51ee3d2a89ba5d5623c73133c8d7a6ba9fb41194c17f4302c21b30994a1180f", "transactionIndex": "0x0"}],
|
||||
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000020000000000000020000000000000000000800000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000004000000000000000000001800000000000000000000000000000100000000020000000000000000000000000000000000000000020000000000000000000100000",
|
||||
"status": "0x1",
|
||||
"to": "0x0d3ab14bbad3d99f4203bd7a11acb94882050e7e",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"blockHash": "0x4d780246cde52e535f40603d47af8fa1aea807dd3065e1acd97127bea0922b3e",
|
||||
"blockNumber": "0x5",
|
||||
"from": "0x703c4b2bd70c169f5717101caee543299fc946c7",
|
||||
"gas": "0xe2f4",
|
||||
"gasPrice": "0x1ecb3fb4",
|
||||
"hash": "0xb5a1148819cfdfff9bfe70035524fec940eb735d89b76960b97751d01ae2a9f2",
|
||||
"input": "0x60806040",
|
||||
"nonce": "0x4",
|
||||
"to": null,
|
||||
"transactionIndex": "0x0",
|
||||
"value": "0x0",
|
||||
"type": "0x1",
|
||||
"accessList": [
|
||||
{
|
||||
"address": "0x0000000000000000000000000000000000031ec7",
|
||||
"storageKeys": [
|
||||
"0x0000000000000000000000000000000000000000000000000000000000000000"
|
||||
]
|
||||
}
|
||||
],
|
||||
"chainId": "0x1",
|
||||
"v": "0x0",
|
||||
"r": "0xb4f6dc1e9c3c5904b7b3969e84dd3eefe68cf1b1951039ccf1848f471660671c",
|
||||
"s": "0x77137b10f51515bcf3268f969a8bee4cb6d0d9521f402b058927071a9cc7e3d8",
|
||||
"yParity": "0x0"
|
||||
}
|
||||
17
internal/ethapi/testdata/eth_getTransactionByBlockHashAndIndex-state-sync-tx.json
vendored
Normal file
17
internal/ethapi/testdata/eth_getTransactionByBlockHashAndIndex-state-sync-tx.json
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"blockHash": "0x4d780246cde52e535f40603d47af8fa1aea807dd3065e1acd97127bea0922b3e",
|
||||
"blockNumber": "0x5",
|
||||
"from": "0x0000000000000000000000000000000000000000",
|
||||
"gas": "0x0",
|
||||
"gasPrice": "0x0",
|
||||
"hash": "0x08ce9234678f85834bdf3ebed2d580dbac00a3899f9e7020e36c9a93fd1a610a",
|
||||
"input": "0x",
|
||||
"nonce": "0x0",
|
||||
"to": "0x0000000000000000000000000000000000000000",
|
||||
"transactionIndex": "0x1",
|
||||
"value": "0x0",
|
||||
"type": "0x0",
|
||||
"v": "0x0",
|
||||
"r": "0x0",
|
||||
"s": "0x0"
|
||||
}
|
||||
18
internal/ethapi/testdata/eth_getTransactionByHash-create-contract-tx.json
vendored
Normal file
18
internal/ethapi/testdata/eth_getTransactionByHash-create-contract-tx.json
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"blockHash": "0xc594f1b119b071d288cd11371da2de73d67986a717974a85cac4ce634eba3015",
|
||||
"blockNumber": "0x2",
|
||||
"from": "0x703c4b2bd70c169f5717101caee543299fc946c7",
|
||||
"gas": "0xcf6c",
|
||||
"gasPrice": "0x2db16291",
|
||||
"hash": "0x340e58cda5086495010b571fe25067fecc9954dc4ee3cedece00691fa3f5904a",
|
||||
"input": "0x60806040",
|
||||
"nonce": "0x1",
|
||||
"to": null,
|
||||
"transactionIndex": "0x0",
|
||||
"value": "0x0",
|
||||
"type": "0x0",
|
||||
"chainId": "0x1",
|
||||
"v": "0x26",
|
||||
"r": "0xfa210b09f8a13ea096b3a005a5feb0270121ab259555898bf03826e993ec14f4",
|
||||
"s": "0x7173d180059852006668647a793207d488723b89acdd6c484273f16beb9aaa3"
|
||||
}
|
||||
27
internal/ethapi/testdata/eth_getTransactionByHash-create-contract-with-access-list.json
vendored
Normal file
27
internal/ethapi/testdata/eth_getTransactionByHash-create-contract-with-access-list.json
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"blockHash": "0x4d780246cde52e535f40603d47af8fa1aea807dd3065e1acd97127bea0922b3e",
|
||||
"blockNumber": "0x5",
|
||||
"from": "0x703c4b2bd70c169f5717101caee543299fc946c7",
|
||||
"gas": "0xe2f4",
|
||||
"gasPrice": "0x1ecb3fb4",
|
||||
"hash": "0xb5a1148819cfdfff9bfe70035524fec940eb735d89b76960b97751d01ae2a9f2",
|
||||
"input": "0x60806040",
|
||||
"nonce": "0x4",
|
||||
"to": null,
|
||||
"transactionIndex": "0x0",
|
||||
"value": "0x0",
|
||||
"type": "0x1",
|
||||
"accessList": [
|
||||
{
|
||||
"address": "0x0000000000000000000000000000000000031ec7",
|
||||
"storageKeys": [
|
||||
"0x0000000000000000000000000000000000000000000000000000000000000000"
|
||||
]
|
||||
}
|
||||
],
|
||||
"chainId": "0x1",
|
||||
"v": "0x0",
|
||||
"r": "0xb4f6dc1e9c3c5904b7b3969e84dd3eefe68cf1b1951039ccf1848f471660671c",
|
||||
"s": "0x77137b10f51515bcf3268f969a8bee4cb6d0d9521f402b058927071a9cc7e3d8",
|
||||
"yParity": "0x0"
|
||||
}
|
||||
22
internal/ethapi/testdata/eth_getTransactionByHash-dynamic-tx-with-logs.json
vendored
Normal file
22
internal/ethapi/testdata/eth_getTransactionByHash-dynamic-tx-with-logs.json
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"blockHash": "0x15158c4fb0661a38967dbf81b1592c54999b44a4580153b3469b29724903fc95",
|
||||
"blockNumber": "0x4",
|
||||
"from": "0x703c4b2bd70c169f5717101caee543299fc946c7",
|
||||
"gas": "0xea60",
|
||||
"gasPrice": "0x2325c42f",
|
||||
"maxFeePerGas": "0x2325c42f",
|
||||
"maxPriorityFeePerGas": "0x1f4",
|
||||
"hash": "0xdcde2574628c9d7dff22b9afa19f235959a924ceec65a9df903a517ae91f5c84",
|
||||
"input": "0xa9059cbb0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e",
|
||||
"nonce": "0x3",
|
||||
"to": "0x0000000000000000000000000000000000031ec7",
|
||||
"transactionIndex": "0x0",
|
||||
"value": "0x1",
|
||||
"type": "0x2",
|
||||
"accessList": [],
|
||||
"chainId": "0x1",
|
||||
"v": "0x1",
|
||||
"r": "0x41fa5d541e9081c6f636e6cb6c5dc0c4369c7d65df9b17f8ac47834f1eba4a6a",
|
||||
"s": "0x6f811df916d0ec44e108740d6d307fd203273c26f9f52a785cb5fc551c5802f9",
|
||||
"yParity": "0x1"
|
||||
}
|
||||
17
internal/ethapi/testdata/eth_getTransactionByHash-normal-transfer-tx.json
vendored
Normal file
17
internal/ethapi/testdata/eth_getTransactionByHash-normal-transfer-tx.json
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"blockHash": "0xfddc403b2acdace77774a35cbad7b68d50ce258fafaac399e21533a3b77ad94a",
|
||||
"blockNumber": "0x1",
|
||||
"from": "0x703c4b2bd70c169f5717101caee543299fc946c7",
|
||||
"gas": "0x5208",
|
||||
"gasPrice": "0x342770c0",
|
||||
"hash": "0x644a31c354391520d00e95b9affbbb010fc79ac268144ab8e28207f4cf51097e",
|
||||
"input": "0x",
|
||||
"nonce": "0x0",
|
||||
"to": "0x0d3ab14bbad3d99f4203bd7a11acb94882050e7e",
|
||||
"transactionIndex": "0x0",
|
||||
"value": "0x3e8",
|
||||
"type": "0x0",
|
||||
"v": "0x1b",
|
||||
"r": "0xcd190747077598c3b9c5f21ea06f8487d6ab1e23358fbe0e0e0c4e64651b68f3",
|
||||
"s": "0x467ebcb2186b332969991e2e25244959dcdb3feb7652ff6b81ce96e646d86abd"
|
||||
}
|
||||
17
internal/ethapi/testdata/eth_getTransactionByHash-state-sync-tx.json
vendored
Normal file
17
internal/ethapi/testdata/eth_getTransactionByHash-state-sync-tx.json
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"blockHash": "0x4d780246cde52e535f40603d47af8fa1aea807dd3065e1acd97127bea0922b3e",
|
||||
"blockNumber": "0x5",
|
||||
"from": "0x0000000000000000000000000000000000000000",
|
||||
"gas": "0x0",
|
||||
"gasPrice": "0x0",
|
||||
"hash": "0x08ce9234678f85834bdf3ebed2d580dbac00a3899f9e7020e36c9a93fd1a610a",
|
||||
"input": "0x",
|
||||
"nonce": "0x0",
|
||||
"to": "0x0000000000000000000000000000000000000000",
|
||||
"transactionIndex": "0x1",
|
||||
"value": "0x0",
|
||||
"type": "0x0",
|
||||
"v": "0x0",
|
||||
"r": "0x0",
|
||||
"s": "0x0"
|
||||
}
|
||||
1
internal/ethapi/testdata/eth_getTransactionByHash-txhash-empty.json
vendored
Normal file
1
internal/ethapi/testdata/eth_getTransactionByHash-txhash-empty.json
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
null
|
||||
1
internal/ethapi/testdata/eth_getTransactionByHash-txhash-notfound.json
vendored
Normal file
1
internal/ethapi/testdata/eth_getTransactionByHash-txhash-notfound.json
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
null
|
||||
18
internal/ethapi/testdata/eth_getTransactionByHash-with-logs.json
vendored
Normal file
18
internal/ethapi/testdata/eth_getTransactionByHash-with-logs.json
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"blockHash": "0x12db9de067ca71d47e360ab4eb9bf7bc80824f5edd39c7576e253f37a1a22782",
|
||||
"blockNumber": "0x3",
|
||||
"from": "0x703c4b2bd70c169f5717101caee543299fc946c7",
|
||||
"gas": "0xea60",
|
||||
"gasPrice": "0x281c2585",
|
||||
"hash": "0xeaf3921cbf03ba45bad4e6ab807b196ce3b2a0b5bacc355b6272fa96b11b4287",
|
||||
"input": "0xa9059cbb0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000d",
|
||||
"nonce": "0x2",
|
||||
"to": "0x0000000000000000000000000000000000031ec7",
|
||||
"transactionIndex": "0x0",
|
||||
"value": "0x0",
|
||||
"type": "0x0",
|
||||
"chainId": "0x1",
|
||||
"v": "0x25",
|
||||
"r": "0xabecc8622990867d3889d6abb094e9247b5af59978c23d95b7020da6efa2c834",
|
||||
"s": "0x31267ff2ffba8d2ff70d908feb98584872c3b3df47454cc3d04f342eb6c68b77"
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
"blobGasPrice": null,
|
||||
"blobGasUsed": "0x20000",
|
||||
"blockHash": "0x4446b1498499cab37cfec330097fadf285c703444d431756940528d32fe0e97b",
|
||||
"blockNumber": "0x6",
|
||||
"contractAddress": null,
|
||||
"cumulativeGasUsed": "0x5208",
|
||||
"effectiveGasPrice": "0x1b09d63b",
|
||||
"from": "0x703c4b2bd70c169f5717101caee543299fc946c7",
|
||||
"gasUsed": "0x5208",
|
||||
"logs": [{"address": "0x0000000000000000000000000000000000001010", "blockHash": "0x4446b1498499cab37cfec330097fadf285c703444d431756940528d32fe0e97b", "blockNumber": "0x6", "data": "0x00000000000000000000000000000000000000000000000000000000000052080000000000000000000000000000000000000000000000000de04bce435b746d0000000000000000000000000000000000000000000000000000000000a32f640000000000000000000000000000000000000000000000000de04bce435b22650000000000000000000000000000000000000000000000000000000000a3816c", "logIndex": "0x0", "removed": false, "topics": ["0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", "0x000000000000000000000000703c4b2bd70c169f5717101caee543299fc946c7", "0x0000000000000000000000000000000000000000000000000000000000000000"], "transactionHash": "0xb51ee3d2a89ba5d5623c73133c8d7a6ba9fb41194c17f4302c21b30994a1180f", "transactionIndex": "0x0"}],
|
||||
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000020000000000000020000000000000000000800000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000004000000000000000000001800000000000000000000000000000100000000020000000000000000000000000000000000000000020000000000000000000100000",
|
||||
"status": "0x1",
|
||||
"to": "0x0d3ab14bbad3d99f4203bd7a11acb94882050e7e",
|
||||
"transactionHash": "0xb51ee3d2a89ba5d5623c73133c8d7a6ba9fb41194c17f4302c21b30994a1180f",
|
||||
"transactionIndex": "0x0",
|
||||
"type": "0x3"
|
||||
}
|
||||
|
|
@ -1,17 +1,16 @@
|
|||
{
|
||||
"blockHash": "0x4d780246cde52e535f40603d47af8fa1aea807dd3065e1acd97127bea0922b3e",
|
||||
"blockNumber": "0x6",
|
||||
"contractAddress": null,
|
||||
"cumulativeGasUsed": "0xe01c",
|
||||
"effectiveGasPrice": "0x1ecb3fb4",
|
||||
"from": "0x703c4b2bd70c169f5717101caee543299fc946c7",
|
||||
"gasUsed": "0xe01c",
|
||||
"logs": [],
|
||||
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
||||
"status": "0x1",
|
||||
"to": null,
|
||||
"transactionHash": "0xb5a1148819cfdfff9bfe70035524fec940eb735d89b76960b97751d01ae2a9f2",
|
||||
"transactionIndex": "0x0",
|
||||
"type": "0x1"
|
||||
}
|
||||
|
||||
"blockHash": "0x4d780246cde52e535f40603d47af8fa1aea807dd3065e1acd97127bea0922b3e",
|
||||
"blockNumber": "0x5",
|
||||
"contractAddress": null,
|
||||
"cumulativeGasUsed": "0x0",
|
||||
"effectiveGasPrice": "0x0",
|
||||
"from": "0x0000000000000000000000000000000000000000",
|
||||
"gasUsed": "0x0",
|
||||
"logs": [],
|
||||
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
||||
"status": "0x1",
|
||||
"to": "0x0000000000000000000000000000000000000000",
|
||||
"transactionHash": "0x08ce9234678f85834bdf3ebed2d580dbac00a3899f9e7020e36c9a93fd1a610a",
|
||||
"transactionIndex": "0x1",
|
||||
"type": "0x0"
|
||||
}
|
||||
|
|
@ -14,7 +14,7 @@ func TestRegistryMarshallJSON(t *testing.T) {
|
|||
enc.Encode(r)
|
||||
|
||||
if s := b.String(); s != "{\"counter\":{\"count\":0}}\n" {
|
||||
t.Fatalf(s)
|
||||
t.Fatal(s)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,762 +0,0 @@
|
|||
package miner
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
// nolint:typecheck
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
cmath "github.com/ethereum/go-ethereum/common/math"
|
||||
"github.com/ethereum/go-ethereum/common/tracing"
|
||||
"github.com/ethereum/go-ethereum/consensus"
|
||||
"github.com/ethereum/go-ethereum/core"
|
||||
"github.com/ethereum/go-ethereum/core/blockstm"
|
||||
"github.com/ethereum/go-ethereum/core/state"
|
||||
"github.com/ethereum/go-ethereum/core/txpool"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/core/vm"
|
||||
"github.com/ethereum/go-ethereum/event"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
"github.com/ethereum/go-ethereum/rlp"
|
||||
"github.com/holiman/uint256"
|
||||
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
|
||||
lru "github.com/hashicorp/golang-lru"
|
||||
)
|
||||
|
||||
// newWorkerWithDelay is newWorker() with extra params to induce artficial delays for tests such as commit-interrupt.
|
||||
// nolint:staticcheck
|
||||
func newWorkerWithDelay(config *Config, chainConfig *params.ChainConfig, engine consensus.Engine, eth Backend, mux *event.TypeMux, isLocalBlock func(header *types.Header) bool, init bool, delay uint, opcodeDelay uint) *worker {
|
||||
worker := &worker{
|
||||
config: config,
|
||||
chainConfig: chainConfig,
|
||||
engine: engine,
|
||||
eth: eth,
|
||||
chain: eth.BlockChain(),
|
||||
mux: mux,
|
||||
isLocalBlock: isLocalBlock,
|
||||
coinbase: config.Etherbase,
|
||||
extra: config.ExtraData,
|
||||
pendingTasks: make(map[common.Hash]*task),
|
||||
txsCh: make(chan core.NewTxsEvent, txChanSize),
|
||||
chainHeadCh: make(chan core.ChainHeadEvent, chainHeadChanSize),
|
||||
newWorkCh: make(chan *newWorkReq),
|
||||
getWorkCh: make(chan *getWorkReq),
|
||||
taskCh: make(chan *task),
|
||||
resultCh: make(chan *types.Block, resultQueueSize),
|
||||
startCh: make(chan struct{}, 1),
|
||||
exitCh: make(chan struct{}),
|
||||
resubmitIntervalCh: make(chan time.Duration),
|
||||
resubmitAdjustCh: make(chan *intervalAdjust, resubmitAdjustChanSize),
|
||||
interruptCommitFlag: config.CommitInterruptFlag,
|
||||
}
|
||||
worker.noempty.Store(true)
|
||||
worker.profileCount = new(int32)
|
||||
// Subscribe for transaction insertion events (whether from network or resurrects)
|
||||
worker.txsSub = eth.TxPool().SubscribeTransactions(worker.txsCh, true)
|
||||
// Subscribe events for blockchain
|
||||
worker.chainHeadSub = eth.BlockChain().SubscribeChainHeadEvent(worker.chainHeadCh)
|
||||
|
||||
interruptedTxCache, err := lru.New(vm.InterruptedTxCacheSize)
|
||||
if err != nil {
|
||||
log.Warn("Failed to create interrupted tx cache", "err", err)
|
||||
}
|
||||
|
||||
worker.interruptedTxCache = &vm.TxCache{
|
||||
Cache: interruptedTxCache,
|
||||
}
|
||||
|
||||
if !worker.interruptCommitFlag {
|
||||
worker.noempty.Store(false)
|
||||
}
|
||||
|
||||
// Sanitize recommit interval if the user-specified one is too short.
|
||||
recommit := worker.config.Recommit
|
||||
if recommit < minRecommitInterval {
|
||||
log.Warn("Sanitizing miner recommit interval", "provided", recommit, "updated", minRecommitInterval)
|
||||
recommit = minRecommitInterval
|
||||
}
|
||||
|
||||
worker.recommit = recommit
|
||||
|
||||
// Sanitize the timeout config for creating payload.
|
||||
newpayloadTimeout := worker.config.NewPayloadTimeout
|
||||
if newpayloadTimeout == 0 {
|
||||
log.Warn("Sanitizing new payload timeout to default", "provided", newpayloadTimeout, "updated", DefaultConfig.NewPayloadTimeout)
|
||||
newpayloadTimeout = DefaultConfig.NewPayloadTimeout
|
||||
}
|
||||
|
||||
if newpayloadTimeout < time.Millisecond*100 {
|
||||
log.Warn("Low payload timeout may cause high amount of non-full blocks", "provided", newpayloadTimeout, "default", DefaultConfig.NewPayloadTimeout)
|
||||
}
|
||||
|
||||
worker.newpayloadTimeout = newpayloadTimeout
|
||||
|
||||
ctx := tracing.WithTracer(context.Background(), otel.GetTracerProvider().Tracer("MinerWorker"))
|
||||
|
||||
worker.wg.Add(4)
|
||||
|
||||
go worker.mainLoopWithDelay(ctx, delay, opcodeDelay)
|
||||
go worker.newWorkLoop(ctx, recommit)
|
||||
go worker.resultLoop()
|
||||
go worker.taskLoop()
|
||||
|
||||
// Submit first work to initialize pending state.
|
||||
if init {
|
||||
worker.startCh <- struct{}{}
|
||||
}
|
||||
|
||||
return worker
|
||||
}
|
||||
|
||||
// mainLoopWithDelay is mainLoop() with extra params to induce artficial delays for tests such as commit-interrupt.
|
||||
// nolint:gocognit
|
||||
func (w *worker) mainLoopWithDelay(ctx context.Context, delay uint, opcodeDelay uint) {
|
||||
defer w.wg.Done()
|
||||
defer w.txsSub.Unsubscribe()
|
||||
defer w.chainHeadSub.Unsubscribe()
|
||||
defer func() {
|
||||
if w.current != nil {
|
||||
w.current.discard()
|
||||
}
|
||||
}()
|
||||
|
||||
for {
|
||||
select {
|
||||
case req := <-w.newWorkCh:
|
||||
if w.chainConfig.ChainID.Cmp(params.BorMainnetChainConfig.ChainID) == 0 || w.chainConfig.ChainID.Cmp(params.MumbaiChainConfig.ChainID) == 0 {
|
||||
if w.eth.PeerCount() > 0 {
|
||||
//nolint:contextcheck
|
||||
w.commitWorkWithDelay(req.ctx, req.interrupt, req.noempty, req.timestamp, delay, opcodeDelay)
|
||||
}
|
||||
} else {
|
||||
//nolint:contextcheck
|
||||
w.commitWorkWithDelay(req.ctx, req.interrupt, req.noempty, req.timestamp, delay, opcodeDelay)
|
||||
}
|
||||
|
||||
case req := <-w.getWorkCh:
|
||||
req.result <- w.generateWork(ctx, req.params)
|
||||
|
||||
case ev := <-w.txsCh:
|
||||
// Apply transactions to the pending state if we're not sealing
|
||||
//
|
||||
// Note all transactions received may not be continuous with transactions
|
||||
// already included in the current sealing block. These transactions will
|
||||
// be automatically eliminated.
|
||||
// nolint : nestif
|
||||
if !w.IsRunning() && w.current != nil {
|
||||
// If block is already full, abort
|
||||
if gp := w.current.gasPool; gp != nil && gp.Gas() < params.TxGas {
|
||||
continue
|
||||
}
|
||||
txs := make(map[common.Address][]*txpool.LazyTransaction, len(ev.Txs))
|
||||
for _, tx := range ev.Txs {
|
||||
acc, _ := types.Sender(w.current.signer, tx)
|
||||
txs[acc] = append(txs[acc], &txpool.LazyTransaction{
|
||||
Pool: w.eth.TxPool(), // We don't know where this came from, yolo resolve from everywhere
|
||||
Hash: tx.Hash(),
|
||||
Tx: nil, // Do *not* set this! We need to resolve it later to pull blobs in
|
||||
Time: tx.Time(),
|
||||
GasFeeCap: uint256.NewInt(tx.GasFeeCap().Uint64()),
|
||||
GasTipCap: uint256.NewInt(tx.GasTipCap().Uint64()),
|
||||
Gas: tx.Gas(),
|
||||
BlobGas: tx.BlobGas(),
|
||||
})
|
||||
}
|
||||
txset := newTransactionsByPriceAndNonce(w.current.signer, txs, w.current.header.BaseFee)
|
||||
tcount := w.current.tcount
|
||||
w.commitTransactions(w.current, txset, nil, nil, new(uint256.Int), context.Background())
|
||||
|
||||
// Only update the snapshot if any new transactons were added
|
||||
// to the pending block
|
||||
if tcount != w.current.tcount {
|
||||
w.updateSnapshot(w.current)
|
||||
}
|
||||
} else {
|
||||
// Special case, if the consensus engine is 0 period clique(dev mode),
|
||||
// submit sealing work here since all empty submission will be rejected
|
||||
// by clique. Of course the advance sealing(empty submission) is disabled.
|
||||
if w.chainConfig.Clique != nil && w.chainConfig.Clique.Period == 0 {
|
||||
w.commitWork(ctx, nil, true, time.Now().Unix())
|
||||
}
|
||||
}
|
||||
|
||||
w.newTxs.Add(int32(len(ev.Txs)))
|
||||
|
||||
// System stopped
|
||||
case <-w.exitCh:
|
||||
return
|
||||
case <-w.txsSub.Err():
|
||||
return
|
||||
case <-w.chainHeadSub.Err():
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// commitWorkWithDelay is commitWork() with extra params to induce artficial delays for tests such as commit-interrupt.
|
||||
func (w *worker) commitWorkWithDelay(ctx context.Context, interrupt *atomic.Int32, noempty bool, timestamp int64, delay uint, opcodeDelay uint) {
|
||||
// Abort committing if node is still syncing
|
||||
if w.syncing.Load() {
|
||||
return
|
||||
}
|
||||
start := time.Now()
|
||||
|
||||
var (
|
||||
work *environment
|
||||
err error
|
||||
)
|
||||
|
||||
tracing.Exec(ctx, "", "worker.prepareWork", func(ctx context.Context, span trace.Span) {
|
||||
// Set the coinbase if the worker is running or it's required
|
||||
var coinbase common.Address
|
||||
if w.IsRunning() {
|
||||
coinbase = w.etherbase()
|
||||
if coinbase == (common.Address{}) {
|
||||
log.Error("Refusing to mine without etherbase")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
work, err = w.prepareWork(&generateParams{
|
||||
timestamp: uint64(timestamp),
|
||||
coinbase: coinbase,
|
||||
})
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// nolint:contextcheck
|
||||
var interruptCtx = context.Background()
|
||||
|
||||
stopFn := func() {}
|
||||
defer func() {
|
||||
stopFn()
|
||||
}()
|
||||
|
||||
if !noempty && w.interruptCommitFlag {
|
||||
block := w.chain.GetBlockByHash(w.chain.CurrentBlock().Hash())
|
||||
interruptCtx, stopFn = getInterruptTimer(ctx, work, block)
|
||||
// nolint : staticcheck
|
||||
interruptCtx = vm.PutCache(interruptCtx, w.interruptedTxCache)
|
||||
// nolint : staticcheck
|
||||
interruptCtx = context.WithValue(interruptCtx, vm.InterruptCtxDelayKey, delay)
|
||||
// nolint : staticcheck
|
||||
interruptCtx = context.WithValue(interruptCtx, vm.InterruptCtxOpcodeDelayKey, opcodeDelay)
|
||||
}
|
||||
|
||||
ctx, span := tracing.StartSpan(ctx, "commitWork")
|
||||
defer tracing.EndSpan(span)
|
||||
|
||||
tracing.SetAttributes(
|
||||
span,
|
||||
attribute.Int("number", int(work.header.Number.Uint64())),
|
||||
)
|
||||
|
||||
// Create an empty block based on temporary copied state for
|
||||
// sealing in advance without waiting block execution finished.
|
||||
if !noempty && !w.noempty.Load() {
|
||||
_ = w.commit(ctx, work.copy(), nil, false, start)
|
||||
}
|
||||
// Fill pending transactions from the txpool into the block.
|
||||
err = w.fillTransactionsWithDelay(ctx, interrupt, work, interruptCtx)
|
||||
|
||||
switch {
|
||||
case err == nil:
|
||||
// The entire block is filled, decrease resubmit interval in case
|
||||
// of current interval is larger than the user-specified one.
|
||||
w.resubmitAdjustCh <- &intervalAdjust{inc: false}
|
||||
|
||||
case errors.Is(err, errBlockInterruptedByRecommit):
|
||||
// Notify resubmit loop to increase resubmitting interval if the
|
||||
// interruption is due to frequent commits.
|
||||
gaslimit := work.header.GasLimit
|
||||
|
||||
ratio := float64(gaslimit-work.gasPool.Gas()) / float64(gaslimit)
|
||||
if ratio < 0.1 {
|
||||
ratio = 0.1
|
||||
}
|
||||
w.resubmitAdjustCh <- &intervalAdjust{
|
||||
ratio: ratio,
|
||||
inc: true,
|
||||
}
|
||||
|
||||
case errors.Is(err, errBlockInterruptedByNewHead):
|
||||
// If the block building is interrupted by newhead event, discard it
|
||||
// totally. Committing the interrupted block introduces unnecessary
|
||||
// delay, and possibly causes miner to mine on the previous head,
|
||||
// which could result in higher uncle rate.
|
||||
work.discard()
|
||||
return
|
||||
}
|
||||
// Submit the generated block for consensus sealing.
|
||||
_ = w.commit(ctx, work.copy(), w.fullTaskHook, true, start)
|
||||
|
||||
// Swap out the old work with the new one, terminating any leftover
|
||||
// prefetcher processes in the mean time and starting a new one.
|
||||
if w.current != nil {
|
||||
w.current.discard()
|
||||
}
|
||||
|
||||
w.current = work
|
||||
}
|
||||
|
||||
// fillTransactionsWithDelay is fillTransactions() with extra params to induce artficial delays for tests such as commit-interrupt.
|
||||
// nolint:gocognit
|
||||
func (w *worker) fillTransactionsWithDelay(ctx context.Context, interrupt *atomic.Int32, env *environment, interruptCtx context.Context) error {
|
||||
ctx, span := tracing.StartSpan(ctx, "fillTransactions")
|
||||
defer tracing.EndSpan(span)
|
||||
|
||||
// Split the pending transactions into locals and remotes
|
||||
// Fill the block with all available pending transactions.
|
||||
pending := w.eth.TxPool().Pending(txpool.PendingFilter{})
|
||||
localTxs, remoteTxs := make(map[common.Address][]*txpool.LazyTransaction), pending
|
||||
|
||||
var (
|
||||
localTxsCount int
|
||||
remoteTxsCount int
|
||||
)
|
||||
|
||||
// TODO: move to config or RPC
|
||||
const profiling = false
|
||||
|
||||
if profiling {
|
||||
doneCh := make(chan struct{})
|
||||
|
||||
defer func() {
|
||||
close(doneCh)
|
||||
}()
|
||||
|
||||
go func(number uint64) {
|
||||
closeFn := func() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-time.After(150 * time.Millisecond):
|
||||
// Check if we've not crossed limit
|
||||
if attempt := atomic.AddInt32(w.profileCount, 1); attempt >= 10 {
|
||||
log.Info("Completed profiling", "attempt", attempt)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
log.Info("Starting profiling in fill transactions", "number", number)
|
||||
|
||||
dir, err := os.MkdirTemp("", fmt.Sprintf("bor-traces-%s-", time.Now().UTC().Format("2006-01-02-150405Z")))
|
||||
if err != nil {
|
||||
log.Error("Error in profiling", "path", dir, "number", number, "err", err)
|
||||
return
|
||||
}
|
||||
|
||||
// grab the cpu profile
|
||||
closeFnInternal, err := startProfiler("cpu", dir, number)
|
||||
if err != nil {
|
||||
log.Error("Error in profiling", "path", dir, "number", number, "err", err)
|
||||
return
|
||||
}
|
||||
|
||||
closeFn = func() error {
|
||||
err := closeFnInternal()
|
||||
|
||||
log.Info("Completed profiling", "path", dir, "number", number, "error", err)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
case <-doneCh:
|
||||
err := closeFn()
|
||||
|
||||
if err != nil {
|
||||
log.Info("closing fillTransactions", "number", number, "error", err)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
}
|
||||
}(env.header.Number.Uint64())
|
||||
}
|
||||
|
||||
tracing.Exec(ctx, "", "worker.SplittingTransactions", func(ctx context.Context, span trace.Span) {
|
||||
prePendingTime := time.Now()
|
||||
|
||||
pending := w.eth.TxPool().Pending(txpool.PendingFilter{})
|
||||
remoteTxs = pending
|
||||
|
||||
postPendingTime := time.Now()
|
||||
|
||||
for _, account := range w.eth.TxPool().Locals() {
|
||||
if txs := remoteTxs[account]; len(txs) > 0 {
|
||||
delete(remoteTxs, account)
|
||||
|
||||
localTxs[account] = txs
|
||||
}
|
||||
}
|
||||
|
||||
postLocalsTime := time.Now()
|
||||
|
||||
tracing.SetAttributes(
|
||||
span,
|
||||
attribute.Int("len of local txs", localTxsCount),
|
||||
attribute.Int("len of remote txs", remoteTxsCount),
|
||||
attribute.String("time taken by Pending()", fmt.Sprintf("%v", postPendingTime.Sub(prePendingTime))),
|
||||
attribute.String("time taken by Locals()", fmt.Sprintf("%v", postLocalsTime.Sub(postPendingTime))),
|
||||
)
|
||||
})
|
||||
|
||||
var (
|
||||
localEnvTCount int
|
||||
remoteEnvTCount int
|
||||
err error
|
||||
)
|
||||
|
||||
if len(localTxs) > 0 {
|
||||
var txs *transactionsByPriceAndNonce
|
||||
|
||||
tracing.Exec(ctx, "", "worker.LocalTransactionsByPriceAndNonce", func(ctx context.Context, span trace.Span) {
|
||||
var baseFee *uint256.Int
|
||||
if env.header.BaseFee != nil {
|
||||
baseFee = cmath.FromBig(env.header.BaseFee)
|
||||
}
|
||||
|
||||
txs = newTransactionsByPriceAndNonce(env.signer, localTxs, baseFee.ToBig())
|
||||
|
||||
tracing.SetAttributes(
|
||||
span,
|
||||
attribute.Int("len of tx local Heads", txs.GetTxs()),
|
||||
)
|
||||
})
|
||||
|
||||
tracing.Exec(ctx, "", "worker.LocalCommitTransactions", func(ctx context.Context, span trace.Span) {
|
||||
err = w.commitTransactionsWithDelay(env, txs, interrupt, interruptCtx)
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
localEnvTCount = env.tcount
|
||||
}
|
||||
|
||||
if len(remoteTxs) > 0 {
|
||||
var txs *transactionsByPriceAndNonce
|
||||
|
||||
tracing.Exec(ctx, "", "worker.RemoteTransactionsByPriceAndNonce", func(ctx context.Context, span trace.Span) {
|
||||
var baseFee *uint256.Int
|
||||
if env.header.BaseFee != nil {
|
||||
baseFee = cmath.FromBig(env.header.BaseFee)
|
||||
}
|
||||
|
||||
txs = newTransactionsByPriceAndNonce(env.signer, remoteTxs, baseFee.ToBig())
|
||||
|
||||
tracing.SetAttributes(
|
||||
span,
|
||||
attribute.Int("len of tx remote Heads", txs.GetTxs()),
|
||||
)
|
||||
})
|
||||
|
||||
tracing.Exec(ctx, "", "worker.RemoteCommitTransactions", func(ctx context.Context, span trace.Span) {
|
||||
err = w.commitTransactionsWithDelay(env, txs, interrupt, interruptCtx)
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
remoteEnvTCount = env.tcount
|
||||
}
|
||||
|
||||
tracing.SetAttributes(
|
||||
span,
|
||||
attribute.Int("len of final local txs ", localEnvTCount),
|
||||
attribute.Int("len of final remote txs", remoteEnvTCount),
|
||||
)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// commitTransactionsWithDelay is commitTransactions() with extra params to induce artficial delays for tests such as commit-interrupt.
|
||||
// nolint:gocognit, unparam
|
||||
func (w *worker) commitTransactionsWithDelay(env *environment, txs *transactionsByPriceAndNonce, interrupt *atomic.Int32, interruptCtx context.Context) error {
|
||||
gasLimit := env.header.GasLimit
|
||||
if env.gasPool == nil {
|
||||
env.gasPool = new(core.GasPool).AddGas(gasLimit)
|
||||
}
|
||||
|
||||
var coalescedLogs []*types.Log
|
||||
|
||||
var depsMVReadList [][]blockstm.ReadDescriptor
|
||||
|
||||
var depsMVFullWriteList [][]blockstm.WriteDescriptor
|
||||
|
||||
var mvReadMapList []map[blockstm.Key]blockstm.ReadDescriptor
|
||||
|
||||
var deps map[int]map[int]bool
|
||||
|
||||
chDeps := make(chan blockstm.TxDep)
|
||||
|
||||
var count int
|
||||
|
||||
var depsWg sync.WaitGroup
|
||||
|
||||
EnableMVHashMap := w.chainConfig.IsCancun(env.header.Number)
|
||||
|
||||
// create and add empty mvHashMap in statedb
|
||||
if EnableMVHashMap {
|
||||
depsMVReadList = [][]blockstm.ReadDescriptor{}
|
||||
|
||||
depsMVFullWriteList = [][]blockstm.WriteDescriptor{}
|
||||
|
||||
mvReadMapList = []map[blockstm.Key]blockstm.ReadDescriptor{}
|
||||
|
||||
deps = map[int]map[int]bool{}
|
||||
|
||||
chDeps = make(chan blockstm.TxDep)
|
||||
|
||||
count = 0
|
||||
|
||||
depsWg.Add(1)
|
||||
|
||||
go func(chDeps chan blockstm.TxDep) {
|
||||
for t := range chDeps {
|
||||
deps = blockstm.UpdateDeps(deps, t)
|
||||
}
|
||||
|
||||
depsWg.Done()
|
||||
}(chDeps)
|
||||
}
|
||||
|
||||
var lastTxHash common.Hash
|
||||
|
||||
mainloop:
|
||||
for {
|
||||
if interruptCtx != nil {
|
||||
if EnableMVHashMap {
|
||||
env.state.AddEmptyMVHashMap()
|
||||
}
|
||||
|
||||
// case of interrupting by timeout
|
||||
select {
|
||||
case <-interruptCtx.Done():
|
||||
txCommitInterruptCounter.Inc(1)
|
||||
log.Warn("Tx Level Interrupt", "hash", lastTxHash)
|
||||
break mainloop
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
// Check interruption signal and abort building if it's fired.
|
||||
if interrupt != nil {
|
||||
if signal := interrupt.Load(); signal != commitInterruptNone {
|
||||
return signalToErr(signal)
|
||||
}
|
||||
}
|
||||
// If we don't have enough gas for any further transactions then we're done.
|
||||
if env.gasPool.Gas() < params.TxGas {
|
||||
log.Trace("Not enough gas for further transactions", "have", env.gasPool, "want", params.TxGas)
|
||||
break
|
||||
}
|
||||
// Retrieve the next transaction and abort if all done.
|
||||
ltx, _ := txs.Peek()
|
||||
if ltx == nil {
|
||||
break
|
||||
}
|
||||
lastTxHash = ltx.Hash
|
||||
// If we don't have enough space for the next transaction, skip the account.
|
||||
if env.gasPool.Gas() < ltx.Gas {
|
||||
log.Trace("Not enough gas left for transaction", "hash", ltx.Hash, "left", env.gasPool.Gas(), "needed", ltx.Gas)
|
||||
txs.Pop()
|
||||
continue
|
||||
}
|
||||
if left := uint64(params.MaxBlobGasPerBlock - env.blobs*params.BlobTxBlobGasPerBlob); left < ltx.BlobGas {
|
||||
log.Trace("Not enough blob gas left for transaction", "hash", ltx.Hash, "left", left, "needed", ltx.BlobGas)
|
||||
txs.Pop()
|
||||
continue
|
||||
}
|
||||
// Transaction seems to fit, pull it up from the pool
|
||||
tx := ltx.Resolve()
|
||||
if tx == nil {
|
||||
log.Trace("Ignoring evicted transaction", "hash", ltx.Hash)
|
||||
txs.Pop()
|
||||
continue
|
||||
}
|
||||
// Error may be ignored here. The error has already been checked
|
||||
// during transaction acceptance is the transaction pool.
|
||||
from, _ := types.Sender(env.signer, tx)
|
||||
|
||||
// not prioritising conditional transaction, yet.
|
||||
//nolint:nestif
|
||||
if options := tx.GetOptions(); options != nil {
|
||||
if err := env.header.ValidateBlockNumberOptionsPIP15(options.BlockNumberMin, options.BlockNumberMax); err != nil {
|
||||
log.Trace("Dropping conditional transaction", "from", from, "hash", tx.Hash(), "reason", err)
|
||||
txs.Pop()
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
if err := env.header.ValidateTimestampOptionsPIP15(options.TimestampMin, options.TimestampMax); err != nil {
|
||||
log.Trace("Dropping conditional transaction", "from", from, "hash", tx.Hash(), "reason", err)
|
||||
txs.Pop()
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
if err := env.state.ValidateKnownAccounts(options.KnownAccounts); err != nil {
|
||||
log.Trace("Dropping conditional transaction", "from", from, "hash", tx.Hash(), "reason", err)
|
||||
txs.Pop()
|
||||
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
// Check whether the tx is replay protected. If we're not in the EIP155 hf
|
||||
// phase, start ignoring the sender until we do.
|
||||
if tx.Protected() && !w.chainConfig.IsEIP155(env.header.Number) {
|
||||
log.Trace("Ignoring replay protected transaction", "hash", ltx.Hash, "eip155", w.chainConfig.EIP155Block)
|
||||
txs.Pop()
|
||||
continue
|
||||
}
|
||||
// Start executing the transaction
|
||||
env.state.SetTxContext(tx.Hash(), env.tcount)
|
||||
|
||||
logs, err := w.commitTransaction(env, tx, interruptCtx)
|
||||
|
||||
if interruptCtx != nil {
|
||||
if delay := interruptCtx.Value(vm.InterruptCtxDelayKey); delay != nil {
|
||||
// nolint : durationcheck
|
||||
time.Sleep(time.Duration(delay.(uint)) * time.Millisecond)
|
||||
}
|
||||
}
|
||||
|
||||
switch {
|
||||
case errors.Is(err, core.ErrNonceTooLow):
|
||||
// New head notification data race between the transaction pool and miner, shift
|
||||
log.Trace("Skipping transaction with low nonce", "hash", ltx.Hash, "sender", from, "nonce", tx.Nonce())
|
||||
txs.Shift()
|
||||
|
||||
case errors.Is(err, nil):
|
||||
// Everything ok, collect the logs and shift in the next transaction from the same account
|
||||
coalescedLogs = append(coalescedLogs, logs...)
|
||||
env.tcount++
|
||||
|
||||
if EnableMVHashMap {
|
||||
depsMVReadList = append(depsMVReadList, env.state.MVReadList())
|
||||
depsMVFullWriteList = append(depsMVFullWriteList, env.state.MVFullWriteList())
|
||||
mvReadMapList = append(mvReadMapList, env.state.MVReadMap())
|
||||
|
||||
temp := blockstm.TxDep{
|
||||
Index: env.tcount - 1,
|
||||
ReadList: depsMVReadList[count],
|
||||
FullWriteList: depsMVFullWriteList,
|
||||
}
|
||||
|
||||
chDeps <- temp
|
||||
count++
|
||||
}
|
||||
|
||||
txs.Shift()
|
||||
default:
|
||||
// Transaction is regarded as invalid, drop all consecutive transactions from
|
||||
// the same sender because of `nonce-too-high` clause.
|
||||
log.Debug("Transaction failed, account skipped", "hash", ltx.Hash, "err", err)
|
||||
txs.Pop()
|
||||
}
|
||||
|
||||
if EnableMVHashMap {
|
||||
env.state.ClearReadMap()
|
||||
env.state.ClearWriteMap()
|
||||
}
|
||||
}
|
||||
|
||||
// nolint:nestif
|
||||
if EnableMVHashMap && w.IsRunning() {
|
||||
close(chDeps)
|
||||
depsWg.Wait()
|
||||
|
||||
var blockExtraData types.BlockExtraData
|
||||
|
||||
tempVanity := env.header.Extra[:types.ExtraVanityLength]
|
||||
tempSeal := env.header.Extra[len(env.header.Extra)-types.ExtraSealLength:]
|
||||
|
||||
if len(mvReadMapList) > 0 {
|
||||
tempDeps := make([][]uint64, len(mvReadMapList))
|
||||
|
||||
for j := range deps[0] {
|
||||
tempDeps[0] = append(tempDeps[0], uint64(j))
|
||||
}
|
||||
|
||||
delayFlag := true
|
||||
|
||||
for i := 1; i <= len(mvReadMapList)-1; i++ {
|
||||
reads := mvReadMapList[i-1]
|
||||
|
||||
_, ok1 := reads[blockstm.NewSubpathKey(env.coinbase, state.BalancePath)]
|
||||
_, ok2 := reads[blockstm.NewSubpathKey(common.HexToAddress(w.chainConfig.Bor.CalculateBurntContract(env.header.Number.Uint64())), state.BalancePath)]
|
||||
|
||||
if ok1 || ok2 {
|
||||
delayFlag = false
|
||||
}
|
||||
|
||||
for j := range deps[i] {
|
||||
tempDeps[i] = append(tempDeps[i], uint64(j))
|
||||
}
|
||||
}
|
||||
|
||||
if err := rlp.DecodeBytes(env.header.Extra[types.ExtraVanityLength:len(env.header.Extra)-types.ExtraSealLength], &blockExtraData); err != nil {
|
||||
log.Error("error while decoding block extra data", "err", err)
|
||||
return err
|
||||
}
|
||||
|
||||
if delayFlag {
|
||||
blockExtraData.TxDependency = tempDeps
|
||||
} else {
|
||||
blockExtraData.TxDependency = nil
|
||||
}
|
||||
} else {
|
||||
blockExtraData.TxDependency = nil
|
||||
}
|
||||
|
||||
blockExtraDataBytes, err := rlp.EncodeToBytes(blockExtraData)
|
||||
if err != nil {
|
||||
log.Error("error while encoding block extra data: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
env.header.Extra = []byte{}
|
||||
|
||||
env.header.Extra = append(tempVanity, blockExtraDataBytes...)
|
||||
|
||||
env.header.Extra = append(env.header.Extra, tempSeal...)
|
||||
}
|
||||
|
||||
if !w.IsRunning() && len(coalescedLogs) > 0 {
|
||||
// We don't push the pendingLogsEvent while we are sealing. The reason is that
|
||||
// when we are sealing, the worker will regenerate a sealing block every 3 seconds.
|
||||
// In order to avoid pushing the repeated pendingLog, we disable the pending log pushing.
|
||||
// make a copy, the state caches the logs and these logs get "upgraded" from pending to mined
|
||||
// logs by filling in the block hash when the block was mined by the local miner. This can
|
||||
// cause a race condition if a log was "upgraded" before the PendingLogsEvent is processed.
|
||||
cpy := make([]*types.Log, len(coalescedLogs))
|
||||
for i, l := range coalescedLogs {
|
||||
cpy[i] = new(types.Log)
|
||||
*cpy[i] = *l
|
||||
}
|
||||
|
||||
w.pendingLogsFeed.Send(cpy)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
484
miner/worker.go
484
miner/worker.go
|
|
@ -17,15 +17,10 @@
|
|||
package miner
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/big"
|
||||
"os"
|
||||
"runtime"
|
||||
"runtime/pprof"
|
||||
ptrace "runtime/trace"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
|
@ -33,8 +28,6 @@ import (
|
|||
lru "github.com/hashicorp/golang-lru"
|
||||
"github.com/holiman/uint256"
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/tracing"
|
||||
|
|
@ -155,8 +148,6 @@ func (env *environment) discard() {
|
|||
|
||||
// task contains all information for consensus engine sealing and result submitting.
|
||||
type task struct {
|
||||
//nolint:containedctx
|
||||
ctx context.Context
|
||||
receipts []*types.Receipt
|
||||
state *state.StateDB
|
||||
block *types.Block
|
||||
|
|
@ -172,8 +163,6 @@ const (
|
|||
|
||||
// newWorkReq represents a request for new sealing work submitting with relative interrupt notifier.
|
||||
type newWorkReq struct {
|
||||
//nolint:containedctx
|
||||
ctx context.Context
|
||||
interrupt *atomic.Int32
|
||||
noempty bool
|
||||
timestamp int64
|
||||
|
|
@ -272,8 +261,9 @@ type worker struct {
|
|||
fullTaskHook func() // Method to call before pushing the full sealing task.
|
||||
resubmitHook func(time.Duration, time.Duration) // Method to call upon updating resubmitting interval.
|
||||
|
||||
profileCount *int32 // Global count for profiling
|
||||
interruptCommitFlag bool // Interrupt commit ( Default true )
|
||||
// Interrupt commit to stop block building on time
|
||||
interruptCommitFlag bool // Denotes whether interrupt commit is enabled or not
|
||||
interruptCtx context.Context
|
||||
interruptedTxCache *vm.TxCache
|
||||
|
||||
// noempty is the flag used to control whether the feature of pre-seal empty
|
||||
|
|
@ -311,7 +301,6 @@ func newWorker(config *Config, chainConfig *params.ChainConfig, engine consensus
|
|||
interruptCommitFlag: config.CommitInterruptFlag,
|
||||
}
|
||||
worker.noempty.Store(true)
|
||||
worker.profileCount = new(int32)
|
||||
// Subscribe for transaction insertion events (whether from network or resurrects)
|
||||
worker.txsSub = eth.TxPool().SubscribeTransactions(worker.txsCh, true)
|
||||
// Subscribe events for blockchain
|
||||
|
|
@ -322,6 +311,7 @@ func newWorker(config *Config, chainConfig *params.ChainConfig, engine consensus
|
|||
log.Warn("Failed to create interrupted tx cache", "err", err)
|
||||
}
|
||||
|
||||
worker.interruptCtx = context.Background()
|
||||
worker.interruptedTxCache = &vm.TxCache{
|
||||
Cache: interruptedTxCache,
|
||||
}
|
||||
|
|
@ -352,12 +342,10 @@ func newWorker(config *Config, chainConfig *params.ChainConfig, engine consensus
|
|||
|
||||
worker.newpayloadTimeout = newpayloadTimeout
|
||||
|
||||
ctx := tracing.WithTracer(context.Background(), otel.GetTracerProvider().Tracer("MinerWorker"))
|
||||
|
||||
worker.wg.Add(4)
|
||||
|
||||
go worker.mainLoop(ctx)
|
||||
go worker.newWorkLoop(ctx, recommit)
|
||||
go worker.mainLoop()
|
||||
go worker.newWorkLoop(recommit)
|
||||
go worker.resultLoop()
|
||||
go worker.taskLoop()
|
||||
|
||||
|
|
@ -483,7 +471,7 @@ func recalcRecommit(minRecommit, prev time.Duration, target float64, inc bool) t
|
|||
// newWorkLoop is a standalone goroutine to submit new sealing work upon received events.
|
||||
//
|
||||
//nolint:gocognit
|
||||
func (w *worker) newWorkLoop(ctx context.Context, recommit time.Duration) {
|
||||
func (w *worker) newWorkLoop(recommit time.Duration) {
|
||||
defer w.wg.Done()
|
||||
|
||||
var (
|
||||
|
|
@ -498,15 +486,13 @@ func (w *worker) newWorkLoop(ctx context.Context, recommit time.Duration) {
|
|||
|
||||
// commit aborts in-flight transaction execution with given signal and resubmits a new one.
|
||||
commit := func(noempty bool, s int32) {
|
||||
ctx, span := tracing.Trace(ctx, "worker.newWorkLoop.commit")
|
||||
tracing.EndSpan(span)
|
||||
if interrupt != nil {
|
||||
interrupt.Store(s)
|
||||
}
|
||||
|
||||
interrupt = new(atomic.Int32)
|
||||
select {
|
||||
case w.newWorkCh <- &newWorkReq{interrupt: interrupt, timestamp: timestamp, ctx: ctx, noempty: noempty}:
|
||||
case w.newWorkCh <- &newWorkReq{interrupt: interrupt, timestamp: timestamp, noempty: noempty}:
|
||||
case <-w.exitCh:
|
||||
return
|
||||
}
|
||||
|
|
@ -515,9 +501,6 @@ func (w *worker) newWorkLoop(ctx context.Context, recommit time.Duration) {
|
|||
}
|
||||
// clearPending cleans the stale pending tasks.
|
||||
clearPending := func(number uint64) {
|
||||
_, span := tracing.Trace(ctx, "worker.newWorkLoop.clearPending")
|
||||
tracing.EndSpan(span)
|
||||
|
||||
w.pendingMu.Lock()
|
||||
for h, t := range w.pendingTasks {
|
||||
if t.block.NumberU64()+staleThreshold <= number {
|
||||
|
|
@ -594,7 +577,7 @@ func (w *worker) newWorkLoop(ctx context.Context, recommit time.Duration) {
|
|||
// the received event. It can support two modes: automatically generate task and
|
||||
// submit it or return task according to given parameters for various proposes.
|
||||
// nolint: gocognit, contextcheck
|
||||
func (w *worker) mainLoop(ctx context.Context) {
|
||||
func (w *worker) mainLoop() {
|
||||
defer w.wg.Done()
|
||||
defer w.txsSub.Unsubscribe()
|
||||
defer w.chainHeadSub.Unsubscribe()
|
||||
|
|
@ -610,15 +593,15 @@ func (w *worker) mainLoop(ctx context.Context) {
|
|||
if w.chainConfig.ChainID.Cmp(params.BorMainnetChainConfig.ChainID) == 0 || w.chainConfig.ChainID.Cmp(params.MumbaiChainConfig.ChainID) == 0 || w.chainConfig.ChainID.Cmp(params.AmoyChainConfig.ChainID) == 0 {
|
||||
if w.eth.PeerCount() > 0 {
|
||||
//nolint:contextcheck
|
||||
w.commitWork(req.ctx, req.interrupt, req.noempty, req.timestamp)
|
||||
w.commitWork(req.interrupt, req.noempty, req.timestamp)
|
||||
}
|
||||
} else {
|
||||
//nolint:contextcheck
|
||||
w.commitWork(req.ctx, req.interrupt, req.noempty, req.timestamp)
|
||||
w.commitWork(req.interrupt, req.noempty, req.timestamp)
|
||||
}
|
||||
|
||||
case req := <-w.getWorkCh:
|
||||
req.result <- w.generateWork(ctx, req.params)
|
||||
req.result <- w.generateWork(req.params)
|
||||
|
||||
case ev := <-w.txsCh:
|
||||
// Apply transactions to the pending state if we're not sealing
|
||||
|
|
@ -632,6 +615,11 @@ func (w *worker) mainLoop(ctx context.Context) {
|
|||
if gp := w.current.gasPool; gp != nil && gp.Gas() < params.TxGas {
|
||||
continue
|
||||
}
|
||||
// If we don't have time to execute (i.e. we're past header timestamp), abort
|
||||
delay := time.Until(time.Unix(int64(w.current.header.Time), 0))
|
||||
if delay <= 0 {
|
||||
continue
|
||||
}
|
||||
txs := make(map[common.Address][]*txpool.LazyTransaction, len(ev.Txs))
|
||||
for _, tx := range ev.Txs {
|
||||
acc, _ := types.Sender(w.current.signer, tx)
|
||||
|
|
@ -651,7 +639,14 @@ func (w *worker) mainLoop(ctx context.Context) {
|
|||
|
||||
tcount := w.current.tcount
|
||||
|
||||
w.commitTransactions(w.current, plainTxs, blobTxs, nil, new(uint256.Int), context.Background())
|
||||
w.interruptCtx = resetAndCopyInterruptCtx(w.interruptCtx)
|
||||
stopFn := func() {}
|
||||
if w.interruptCommitFlag {
|
||||
w.interruptCtx, stopFn = getInterruptTimer(w.interruptCtx, w.current.header.Number.Uint64(), w.current.header.Time)
|
||||
w.interruptCtx = vm.PutCache(w.interruptCtx, w.interruptedTxCache)
|
||||
}
|
||||
w.commitTransactions(w.current, plainTxs, blobTxs, nil, new(uint256.Int))
|
||||
stopFn()
|
||||
|
||||
// Only update the snapshot if any new transactons were added
|
||||
// to the pending block
|
||||
|
|
@ -663,7 +658,7 @@ func (w *worker) mainLoop(ctx context.Context) {
|
|||
// submit sealing work here since all empty submission will be rejected
|
||||
// by clique. Of course the advance sealing(empty submission) is disabled.
|
||||
if w.chainConfig.Clique != nil && w.chainConfig.Clique.Period == 0 {
|
||||
w.commitWork(ctx, nil, true, time.Now().Unix())
|
||||
w.commitWork(nil, true, time.Now().Unix())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -722,7 +717,7 @@ func (w *worker) taskLoop() {
|
|||
w.pendingTasks[sealHash] = task
|
||||
w.pendingMu.Unlock()
|
||||
|
||||
if err := w.engine.Seal(task.ctx, w.chain, task.block, w.resultCh, stopCh); err != nil {
|
||||
if err := w.engine.Seal(w.chain, task.block, w.resultCh, stopCh); err != nil {
|
||||
log.Warn("Block sealing failed", "err", err)
|
||||
w.pendingMu.Lock()
|
||||
delete(w.pendingTasks, sealHash)
|
||||
|
|
@ -783,45 +778,31 @@ func (w *worker) resultLoop() {
|
|||
err error
|
||||
)
|
||||
|
||||
tracing.Exec(task.ctx, "", "resultLoop", func(ctx context.Context, span trace.Span) {
|
||||
for i, taskReceipt := range task.receipts {
|
||||
receipt := new(types.Receipt)
|
||||
receipts[i] = receipt
|
||||
*receipt = *taskReceipt
|
||||
for i, taskReceipt := range task.receipts {
|
||||
receipt := new(types.Receipt)
|
||||
receipts[i] = receipt
|
||||
*receipt = *taskReceipt
|
||||
|
||||
// add block location fields
|
||||
receipt.BlockHash = hash
|
||||
receipt.BlockNumber = block.Number()
|
||||
receipt.TransactionIndex = uint(i)
|
||||
// add block location fields
|
||||
receipt.BlockHash = hash
|
||||
receipt.BlockNumber = block.Number()
|
||||
receipt.TransactionIndex = uint(i)
|
||||
|
||||
// Update the block hash in all logs since it is now available and not when the
|
||||
// receipt/log of individual transactions were created.
|
||||
receipt.Logs = make([]*types.Log, len(taskReceipt.Logs))
|
||||
// Update the block hash in all logs since it is now available and not when the
|
||||
// receipt/log of individual transactions were created.
|
||||
receipt.Logs = make([]*types.Log, len(taskReceipt.Logs))
|
||||
|
||||
for i, taskLog := range taskReceipt.Logs {
|
||||
log := new(types.Log)
|
||||
receipt.Logs[i] = log
|
||||
*log = *taskLog
|
||||
log.BlockHash = hash
|
||||
}
|
||||
|
||||
logs = append(logs, receipt.Logs...)
|
||||
for i, taskLog := range taskReceipt.Logs {
|
||||
log := new(types.Log)
|
||||
receipt.Logs[i] = log
|
||||
*log = *taskLog
|
||||
log.BlockHash = hash
|
||||
}
|
||||
// Commit block and state to database.
|
||||
tracing.Exec(ctx, "", "resultLoop.WriteBlockAndSetHead", func(ctx context.Context, span trace.Span) {
|
||||
_, err = w.chain.WriteBlockAndSetHead(ctx, block, receipts, logs, task.state, true)
|
||||
})
|
||||
|
||||
tracing.SetAttributes(
|
||||
span,
|
||||
attribute.String("hash", hash.String()),
|
||||
attribute.Int("number", int(block.Number().Uint64())),
|
||||
attribute.Int("txns", block.Transactions().Len()),
|
||||
attribute.Int("gas used", int(block.GasUsed())),
|
||||
attribute.Int("elapsed", int(time.Since(task.createdAt).Milliseconds())),
|
||||
attribute.Bool("error", err != nil),
|
||||
)
|
||||
})
|
||||
logs = append(logs, receipt.Logs...)
|
||||
}
|
||||
// Commit block and state to database.
|
||||
_, err = w.chain.WriteBlockAndSetHead(block, receipts, logs, task.state, true)
|
||||
|
||||
if err != nil {
|
||||
log.Error("Failed writing block to chain", "err", err)
|
||||
|
|
@ -891,16 +872,14 @@ func (w *worker) updateSnapshot(env *environment) {
|
|||
w.snapshotState = env.state.Copy()
|
||||
}
|
||||
|
||||
func (w *worker) commitTransaction(env *environment, tx *types.Transaction, interruptCtx context.Context) ([]*types.Log, error) {
|
||||
func (w *worker) commitTransaction(env *environment, tx *types.Transaction) ([]*types.Log, error) {
|
||||
var (
|
||||
snap = env.state.Snapshot()
|
||||
gp = env.gasPool.Gas()
|
||||
)
|
||||
|
||||
// nolint : staticcheck
|
||||
interruptCtx = vm.SetCurrentTxOnContext(interruptCtx, tx.Hash())
|
||||
|
||||
receipt, err := core.ApplyTransaction(w.chainConfig, w.chain, &env.coinbase, env.gasPool, env.state, env.header, tx, &env.header.GasUsed, *w.chain.GetVMConfig(), interruptCtx)
|
||||
w.interruptCtx = vm.SetCurrentTxOnContext(w.interruptCtx, tx.Hash())
|
||||
receipt, err := core.ApplyTransaction(w.chainConfig, w.chain, &env.coinbase, env.gasPool, env.state, env.header, tx, &env.header.GasUsed, *w.chain.GetVMConfig(), w.interruptCtx)
|
||||
if err != nil {
|
||||
env.state.RevertToSnapshot(snap)
|
||||
env.gasPool.SetGas(gp)
|
||||
|
|
@ -913,7 +892,7 @@ func (w *worker) commitTransaction(env *environment, tx *types.Transaction, inte
|
|||
return receipt.Logs, nil
|
||||
}
|
||||
|
||||
func (w *worker) commitTransactions(env *environment, plainTxs, blobTxs *transactionsByPriceAndNonce, interrupt *atomic.Int32, minTip *uint256.Int, interruptCtx context.Context) error {
|
||||
func (w *worker) commitTransactions(env *environment, plainTxs, blobTxs *transactionsByPriceAndNonce, interrupt *atomic.Int32, minTip *uint256.Int) error {
|
||||
gasLimit := env.header.GasLimit
|
||||
if env.gasPool == nil {
|
||||
env.gasPool = new(core.GasPool).AddGas(gasLimit)
|
||||
|
|
@ -963,16 +942,16 @@ mainloop:
|
|||
}
|
||||
}
|
||||
|
||||
if interruptCtx != nil {
|
||||
if w.interruptCtx != nil {
|
||||
if EnableMVHashMap && w.IsRunning() {
|
||||
env.state.AddEmptyMVHashMap()
|
||||
}
|
||||
|
||||
// case of interrupting by timeout
|
||||
select {
|
||||
case <-interruptCtx.Done():
|
||||
case <-w.interruptCtx.Done():
|
||||
txCommitInterruptCounter.Inc(1)
|
||||
log.Warn("Tx Level Interrupt", "hash", lastTxHash)
|
||||
log.Warn("Tx Level Interrupt", "hash", lastTxHash, "err", w.interruptCtx.Err())
|
||||
break mainloop
|
||||
default:
|
||||
}
|
||||
|
|
@ -1077,7 +1056,15 @@ mainloop:
|
|||
// Start executing the transaction
|
||||
env.state.SetTxContext(tx.Hash(), env.tcount)
|
||||
|
||||
logs, err := w.commitTransaction(env, tx, interruptCtx)
|
||||
logs, err := w.commitTransaction(env, tx)
|
||||
|
||||
// Check if we have a `delay` set in interrupt context. It's only set during tests.
|
||||
if w.interruptCtx != nil {
|
||||
if delay := w.interruptCtx.Value(vm.InterruptCtxDelayKey); delay != nil {
|
||||
// nolint : durationcheck
|
||||
time.Sleep(time.Duration(delay.(uint)) * time.Millisecond)
|
||||
}
|
||||
}
|
||||
|
||||
switch {
|
||||
case errors.Is(err, core.ErrNonceTooLow):
|
||||
|
|
@ -1301,80 +1288,13 @@ func (w *worker) prepareWork(genParams *generateParams) (*environment, error) {
|
|||
return env, nil
|
||||
}
|
||||
|
||||
func startProfiler(profile string, filepath string, number uint64) (func() error, error) {
|
||||
var (
|
||||
buf bytes.Buffer
|
||||
err error
|
||||
)
|
||||
|
||||
closeFn := func() {}
|
||||
|
||||
switch profile {
|
||||
case "cpu":
|
||||
err = pprof.StartCPUProfile(&buf)
|
||||
|
||||
if err == nil {
|
||||
closeFn = func() {
|
||||
pprof.StopCPUProfile()
|
||||
}
|
||||
}
|
||||
case "trace":
|
||||
err = ptrace.Start(&buf)
|
||||
|
||||
if err == nil {
|
||||
closeFn = func() {
|
||||
ptrace.Stop()
|
||||
}
|
||||
}
|
||||
case "heap":
|
||||
runtime.GC()
|
||||
|
||||
err = pprof.WriteHeapProfile(&buf)
|
||||
default:
|
||||
log.Info("Incorrect profile name")
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return func() error {
|
||||
closeFn()
|
||||
return nil
|
||||
}, err
|
||||
}
|
||||
|
||||
closeFnNew := func() error {
|
||||
var err error
|
||||
|
||||
closeFn()
|
||||
|
||||
if buf.Len() == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
f, err := os.Create(filepath + "/" + profile + "-" + fmt.Sprint(number) + ".prof")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defer f.Close()
|
||||
|
||||
_, err = f.Write(buf.Bytes())
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
return closeFnNew, nil
|
||||
}
|
||||
|
||||
// fillTransactions retrieves the pending transactions from the txpool and fills them
|
||||
// into the given sealing block. The transaction selection and ordering strategy can
|
||||
// be customized with the plugin in the future.
|
||||
|
||||
//
|
||||
//nolint:gocognit
|
||||
func (w *worker) fillTransactions(ctx context.Context, interrupt *atomic.Int32, env *environment, interruptCtx context.Context) error {
|
||||
ctx, span := tracing.StartSpan(ctx, "fillTransactions")
|
||||
defer tracing.EndSpan(span)
|
||||
|
||||
func (w *worker) fillTransactions(interrupt *atomic.Int32, env *environment) error {
|
||||
w.mu.RLock()
|
||||
tip := w.tip
|
||||
w.mu.RUnlock()
|
||||
|
|
@ -1392,188 +1312,66 @@ func (w *worker) fillTransactions(ctx context.Context, interrupt *atomic.Int32,
|
|||
filter.BlobFee = uint256.MustFromBig(eip4844.CalcBlobFee(*env.header.ExcessBlobGas))
|
||||
}
|
||||
|
||||
var (
|
||||
localPlainTxsCount int
|
||||
remotePlainTxsCount int
|
||||
)
|
||||
|
||||
// TODO: move to config or RPC
|
||||
const profiling = false
|
||||
|
||||
if profiling {
|
||||
doneCh := make(chan struct{})
|
||||
|
||||
defer func() {
|
||||
close(doneCh)
|
||||
}()
|
||||
|
||||
go func(number uint64) {
|
||||
closeFn := func() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-time.After(150 * time.Millisecond):
|
||||
// Check if we've not crossed limit
|
||||
if attempt := atomic.AddInt32(w.profileCount, 1); attempt >= 10 {
|
||||
log.Info("Completed profiling", "attempt", attempt)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
log.Info("Starting profiling in fill transactions", "number", number)
|
||||
|
||||
dir, err := os.MkdirTemp("", fmt.Sprintf("bor-traces-%s-", time.Now().UTC().Format("2006-01-02-150405Z")))
|
||||
if err != nil {
|
||||
log.Error("Error in profiling", "path", dir, "number", number, "err", err)
|
||||
return
|
||||
}
|
||||
|
||||
// grab the cpu profile
|
||||
closeFnInternal, err := startProfiler("cpu", dir, number)
|
||||
if err != nil {
|
||||
log.Error("Error in profiling", "path", dir, "number", number, "err", err)
|
||||
return
|
||||
}
|
||||
|
||||
closeFn = func() error {
|
||||
err := closeFnInternal()
|
||||
|
||||
log.Info("Completed profiling", "path", dir, "number", number, "error", err)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
case <-doneCh:
|
||||
err := closeFn()
|
||||
|
||||
if err != nil {
|
||||
log.Info("closing fillTransactions", "number", number, "error", err)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
}
|
||||
}(env.header.Number.Uint64())
|
||||
}
|
||||
|
||||
var (
|
||||
localPlainTxs, remotePlainTxs, localBlobTxs, remoteBlobTxs map[common.Address][]*txpool.LazyTransaction
|
||||
)
|
||||
|
||||
tracing.Exec(ctx, "", "worker.SplittingTransactions", func(ctx context.Context, span trace.Span) {
|
||||
prePendingTime := time.Now()
|
||||
filter.OnlyPlainTxs, filter.OnlyBlobTxs = true, false
|
||||
pendingPlainTxs := w.eth.TxPool().Pending(filter)
|
||||
|
||||
filter.OnlyPlainTxs, filter.OnlyBlobTxs = true, false
|
||||
pendingPlainTxs := w.eth.TxPool().Pending(filter)
|
||||
filter.OnlyPlainTxs, filter.OnlyBlobTxs = false, true
|
||||
pendingBlobTxs := w.eth.TxPool().Pending(filter)
|
||||
|
||||
filter.OnlyPlainTxs, filter.OnlyBlobTxs = false, true
|
||||
pendingBlobTxs := w.eth.TxPool().Pending(filter)
|
||||
// Split the pending transactions into locals and remotes.
|
||||
localPlainTxs, remotePlainTxs = make(map[common.Address][]*txpool.LazyTransaction), pendingPlainTxs
|
||||
localBlobTxs, remoteBlobTxs = make(map[common.Address][]*txpool.LazyTransaction), pendingBlobTxs
|
||||
|
||||
// Split the pending transactions into locals and remotes.
|
||||
localPlainTxs, remotePlainTxs = make(map[common.Address][]*txpool.LazyTransaction), pendingPlainTxs
|
||||
localBlobTxs, remoteBlobTxs = make(map[common.Address][]*txpool.LazyTransaction), pendingBlobTxs
|
||||
|
||||
postPendingTime := time.Now()
|
||||
|
||||
for _, account := range w.eth.TxPool().Locals() {
|
||||
if txs := remotePlainTxs[account]; len(txs) > 0 {
|
||||
delete(remotePlainTxs, account)
|
||||
localPlainTxs[account] = txs
|
||||
}
|
||||
if txs := remoteBlobTxs[account]; len(txs) > 0 {
|
||||
delete(remoteBlobTxs, account)
|
||||
localBlobTxs[account] = txs
|
||||
}
|
||||
for _, account := range w.eth.TxPool().Locals() {
|
||||
if txs := remotePlainTxs[account]; len(txs) > 0 {
|
||||
delete(remotePlainTxs, account)
|
||||
localPlainTxs[account] = txs
|
||||
}
|
||||
|
||||
postLocalsTime := time.Now()
|
||||
|
||||
tracing.SetAttributes(
|
||||
span,
|
||||
attribute.Int("len of local txs", localPlainTxsCount),
|
||||
attribute.Int("len of remote txs", remotePlainTxsCount),
|
||||
attribute.String("time taken by Pending()", fmt.Sprintf("%v", postPendingTime.Sub(prePendingTime))),
|
||||
attribute.String("time taken by Locals()", fmt.Sprintf("%v", postLocalsTime.Sub(postPendingTime))),
|
||||
)
|
||||
})
|
||||
|
||||
var (
|
||||
localEnvTCount int
|
||||
remoteEnvTCount int
|
||||
err error
|
||||
)
|
||||
if txs := remoteBlobTxs[account]; len(txs) > 0 {
|
||||
delete(remoteBlobTxs, account)
|
||||
localBlobTxs[account] = txs
|
||||
}
|
||||
}
|
||||
|
||||
// Fill the block with all available pending transactions.
|
||||
if len(localPlainTxs) > 0 || len(localBlobTxs) > 0 {
|
||||
var plainTxs, blobTxs *transactionsByPriceAndNonce
|
||||
|
||||
tracing.Exec(ctx, "", "worker.LocalTransactionsByPriceAndNonce", func(ctx context.Context, span trace.Span) {
|
||||
plainTxs = newTransactionsByPriceAndNonce(env.signer, localPlainTxs, env.header.BaseFee)
|
||||
blobTxs = newTransactionsByPriceAndNonce(env.signer, localBlobTxs, env.header.BaseFee)
|
||||
plainTxs = newTransactionsByPriceAndNonce(env.signer, localPlainTxs, env.header.BaseFee)
|
||||
blobTxs = newTransactionsByPriceAndNonce(env.signer, localBlobTxs, env.header.BaseFee)
|
||||
|
||||
tracing.SetAttributes(
|
||||
span,
|
||||
attribute.Int("len of tx local Heads", plainTxs.GetTxs()),
|
||||
)
|
||||
})
|
||||
|
||||
tracing.Exec(ctx, "", "worker.LocalCommitTransactions", func(ctx context.Context, span trace.Span) {
|
||||
err = w.commitTransactions(env, plainTxs, blobTxs, interrupt, new(uint256.Int), interruptCtx)
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
if err := w.commitTransactions(env, plainTxs, blobTxs, interrupt, new(uint256.Int)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
localEnvTCount = env.tcount
|
||||
}
|
||||
|
||||
if len(remotePlainTxs) > 0 || len(remoteBlobTxs) > 0 {
|
||||
var plainTxs, blobTxs *transactionsByPriceAndNonce
|
||||
|
||||
tracing.Exec(ctx, "", "worker.RemoteTransactionsByPriceAndNonce", func(ctx context.Context, span trace.Span) {
|
||||
plainTxs = newTransactionsByPriceAndNonce(env.signer, remotePlainTxs, env.header.BaseFee)
|
||||
blobTxs = newTransactionsByPriceAndNonce(env.signer, remoteBlobTxs, env.header.BaseFee)
|
||||
plainTxs = newTransactionsByPriceAndNonce(env.signer, remotePlainTxs, env.header.BaseFee)
|
||||
blobTxs = newTransactionsByPriceAndNonce(env.signer, remoteBlobTxs, env.header.BaseFee)
|
||||
|
||||
tracing.SetAttributes(
|
||||
span,
|
||||
attribute.Int("len of tx remote Heads", plainTxs.GetTxs()),
|
||||
)
|
||||
})
|
||||
|
||||
tracing.Exec(ctx, "", "worker.RemoteCommitTransactions", func(ctx context.Context, span trace.Span) {
|
||||
err = w.commitTransactions(env, plainTxs, blobTxs, interrupt, new(uint256.Int), interruptCtx)
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
if err := w.commitTransactions(env, plainTxs, blobTxs, interrupt, new(uint256.Int)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
remoteEnvTCount = env.tcount
|
||||
}
|
||||
|
||||
tracing.SetAttributes(
|
||||
span,
|
||||
attribute.Int("len of final local txs ", localEnvTCount),
|
||||
attribute.Int("len of final remote txs", remoteEnvTCount),
|
||||
)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// generateWork generates a sealing block based on the given parameters.
|
||||
func (w *worker) generateWork(ctx context.Context, params *generateParams) *newPayloadResult {
|
||||
func (w *worker) generateWork(params *generateParams) *newPayloadResult {
|
||||
work, err := w.prepareWork(params)
|
||||
if err != nil {
|
||||
return &newPayloadResult{err: err}
|
||||
}
|
||||
defer work.discard()
|
||||
|
||||
// nolint : contextcheck
|
||||
var interruptCtx = context.Background()
|
||||
|
||||
w.interruptCtx = resetAndCopyInterruptCtx(w.interruptCtx)
|
||||
if !params.noTxs {
|
||||
interrupt := new(atomic.Int32)
|
||||
|
||||
|
|
@ -1582,7 +1380,7 @@ func (w *worker) generateWork(ctx context.Context, params *generateParams) *newP
|
|||
})
|
||||
defer timer.Stop()
|
||||
|
||||
err := w.fillTransactions(ctx, interrupt, work, interruptCtx)
|
||||
err := w.fillTransactions(interrupt, work)
|
||||
if errors.Is(err, errBlockInterruptedByTimeout) {
|
||||
log.Warn("Block building is interrupted", "allowance", common.PrettyDuration(w.newpayloadTimeout))
|
||||
}
|
||||
|
|
@ -1605,7 +1403,7 @@ func (w *worker) generateWork(ctx context.Context, params *generateParams) *newP
|
|||
|
||||
// commitWork generates several new sealing tasks based on the parent block
|
||||
// and submit them to the sealer.
|
||||
func (w *worker) commitWork(ctx context.Context, interrupt *atomic.Int32, noempty bool, timestamp int64) {
|
||||
func (w *worker) commitWork(interrupt *atomic.Int32, noempty bool, timestamp int64) {
|
||||
// Abort committing if node is still syncing
|
||||
if w.syncing.Load() {
|
||||
return
|
||||
|
|
@ -1617,57 +1415,42 @@ func (w *worker) commitWork(ctx context.Context, interrupt *atomic.Int32, noempt
|
|||
err error
|
||||
)
|
||||
|
||||
tracing.Exec(ctx, "", "worker.prepareWork", func(ctx context.Context, span trace.Span) {
|
||||
// Set the coinbase if the worker is running or it's required
|
||||
var coinbase common.Address
|
||||
if w.IsRunning() {
|
||||
coinbase = w.etherbase()
|
||||
if coinbase == (common.Address{}) {
|
||||
log.Error("Refusing to mine without etherbase")
|
||||
return
|
||||
}
|
||||
// Set the coinbase if the worker is running or it's required
|
||||
var coinbase common.Address
|
||||
if w.IsRunning() {
|
||||
coinbase = w.etherbase()
|
||||
if coinbase == (common.Address{}) {
|
||||
log.Error("Refusing to mine without etherbase")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
work, err = w.prepareWork(&generateParams{
|
||||
timestamp: uint64(timestamp),
|
||||
coinbase: coinbase,
|
||||
})
|
||||
work, err = w.prepareWork(&generateParams{
|
||||
timestamp: uint64(timestamp),
|
||||
coinbase: coinbase,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// nolint:contextcheck
|
||||
var interruptCtx = context.Background()
|
||||
|
||||
w.interruptCtx = resetAndCopyInterruptCtx(w.interruptCtx)
|
||||
stopFn := func() {}
|
||||
defer func() {
|
||||
stopFn()
|
||||
}()
|
||||
|
||||
if !noempty && w.interruptCommitFlag {
|
||||
block := w.chain.GetBlockByHash(w.chain.CurrentBlock().Hash())
|
||||
interruptCtx, stopFn = getInterruptTimer(ctx, work, block)
|
||||
// nolint : staticcheck
|
||||
interruptCtx = vm.PutCache(interruptCtx, w.interruptedTxCache)
|
||||
w.interruptCtx, stopFn = getInterruptTimer(w.interruptCtx, work.header.Number.Uint64(), work.header.Time)
|
||||
w.interruptCtx = vm.PutCache(w.interruptCtx, w.interruptedTxCache)
|
||||
}
|
||||
|
||||
ctx, span := tracing.StartSpan(ctx, "commitWork")
|
||||
defer tracing.EndSpan(span)
|
||||
|
||||
tracing.SetAttributes(
|
||||
span,
|
||||
attribute.Int("number", int(work.header.Number.Uint64())),
|
||||
)
|
||||
|
||||
// Create an empty block based on temporary copied state for
|
||||
// sealing in advance without waiting block execution finished.
|
||||
if !noempty && !w.noempty.Load() {
|
||||
_ = w.commit(ctx, work.copy(), nil, false, start)
|
||||
_ = w.commit(work.copy(), nil, false, start)
|
||||
}
|
||||
// Fill pending transactions from the txpool into the block.
|
||||
err = w.fillTransactions(ctx, interrupt, work, interruptCtx)
|
||||
err = w.fillTransactions(interrupt, work)
|
||||
|
||||
switch {
|
||||
case err == nil:
|
||||
|
|
@ -1698,7 +1481,7 @@ func (w *worker) commitWork(ctx context.Context, interrupt *atomic.Int32, noempt
|
|||
return
|
||||
}
|
||||
// Submit the generated block for consensus sealing.
|
||||
_ = w.commit(ctx, work.copy(), w.fullTaskHook, true, start)
|
||||
_ = w.commit(work.copy(), w.fullTaskHook, true, start)
|
||||
|
||||
// Swap out the old work with the new one, terminating any leftover
|
||||
// prefetcher processes in the mean time and starting a new one.
|
||||
|
|
@ -1709,21 +1492,31 @@ func (w *worker) commitWork(ctx context.Context, interrupt *atomic.Int32, noempt
|
|||
w.current = work
|
||||
}
|
||||
|
||||
func getInterruptTimer(ctx context.Context, work *environment, current *types.Block) (context.Context, func()) {
|
||||
delay := time.Until(time.Unix(int64(work.header.Time), 0))
|
||||
// resetAndCopyInterruptCtx resets the interrupt context and copies the values set
|
||||
// from the old one to newly created one. It is necessary to reset context in this way
|
||||
// to get rid of the older parent timeout context.
|
||||
func resetAndCopyInterruptCtx(interruptCtx context.Context) context.Context {
|
||||
// Create a fresh new context and copy values from old one
|
||||
newCtx := context.Background()
|
||||
if delay := interruptCtx.Value(vm.InterruptCtxDelayKey); delay != nil {
|
||||
newCtx = context.WithValue(newCtx, vm.InterruptCtxDelayKey, delay)
|
||||
}
|
||||
if opcodeDelay := interruptCtx.Value(vm.InterruptCtxOpcodeDelayKey); opcodeDelay != nil {
|
||||
newCtx = context.WithValue(newCtx, vm.InterruptCtxOpcodeDelayKey, opcodeDelay)
|
||||
}
|
||||
|
||||
interruptCtx, cancel := context.WithTimeout(context.Background(), delay)
|
||||
return newCtx
|
||||
}
|
||||
|
||||
blockNumber := current.NumberU64() + 1
|
||||
func getInterruptTimer(interruptCtx context.Context, number, timestamp uint64) (context.Context, func()) {
|
||||
delay := time.Until(time.Unix(int64(timestamp), 0))
|
||||
interruptCtx, cancel := context.WithTimeout(interruptCtx, delay)
|
||||
|
||||
go func() {
|
||||
select {
|
||||
case <-interruptCtx.Done():
|
||||
if interruptCtx.Err() != context.Canceled {
|
||||
log.Info("Commit Interrupt. Pre-committing the current block", "block", blockNumber)
|
||||
cancel()
|
||||
}
|
||||
case <-ctx.Done(): // nothing to do
|
||||
<-interruptCtx.Done()
|
||||
if interruptCtx.Err() != context.Canceled {
|
||||
log.Info("Commit Interrupt. Pre-committing the current block", "block", number)
|
||||
cancel()
|
||||
}
|
||||
}()
|
||||
|
||||
|
|
@ -1734,11 +1527,8 @@ func getInterruptTimer(ctx context.Context, work *environment, current *types.Bl
|
|||
// and commits new work if consensus engine is running.
|
||||
// Note the assumption is held that the mutation is allowed to the passed env, do
|
||||
// the deep copy first.
|
||||
func (w *worker) commit(ctx context.Context, env *environment, interval func(), update bool, start time.Time) error {
|
||||
func (w *worker) commit(env *environment, interval func(), update bool, start time.Time) error {
|
||||
if w.IsRunning() {
|
||||
ctx, span := tracing.StartSpan(ctx, "commit")
|
||||
defer tracing.EndSpan(span)
|
||||
|
||||
if interval != nil {
|
||||
interval()
|
||||
}
|
||||
|
|
@ -1749,21 +1539,13 @@ func (w *worker) commit(ctx context.Context, env *environment, interval func(),
|
|||
block, err := w.engine.FinalizeAndAssemble(w.chain, env.header, env.state, &types.Body{
|
||||
Transactions: env.txs,
|
||||
}, env.receipts)
|
||||
tracing.SetAttributes(
|
||||
span,
|
||||
attribute.Int("number", int(env.header.Number.Uint64())),
|
||||
attribute.String("hash", env.header.Hash().String()),
|
||||
attribute.String("sealhash", w.engine.SealHash(env.header).String()),
|
||||
attribute.Int("len of env.txs", len(env.txs)),
|
||||
attribute.Bool("error", err != nil),
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
select {
|
||||
case w.taskCh <- &task{ctx: ctx, receipts: env.receipts, state: env.state, block: block, createdAt: time.Now()}:
|
||||
case w.taskCh <- &task{receipts: env.receipts, state: env.state, block: block, createdAt: time.Now()}:
|
||||
fees := totalFees(block, env.receipts)
|
||||
feesInEther := new(big.Float).Quo(new(big.Float).SetInt(fees), big.NewFloat(params.Ether))
|
||||
log.Info("Commit new sealing work", "number", block.Number(), "sealhash", w.engine.SealHash(block.Header()),
|
||||
|
|
@ -1810,6 +1592,12 @@ func (w *worker) adjustResubmitInterval(message *intervalAdjust) {
|
|||
}
|
||||
}
|
||||
|
||||
// setInterruptCtx sets `value` for given `key` for interrupt commit logic. To be only
|
||||
// used for e2e unit tests.
|
||||
func (w *worker) setInterruptCtx(key any, value any) {
|
||||
w.interruptCtx = context.WithValue(w.interruptCtx, key, value)
|
||||
}
|
||||
|
||||
// copyReceipts makes a deep copy of the given receipts.
|
||||
func copyReceipts(receipts []*types.Receipt) []*types.Receipt {
|
||||
result := make([]*types.Receipt, len(receipts))
|
||||
|
|
|
|||
|
|
@ -320,13 +320,10 @@ func (b *testWorkerBackend) newStorageContractCallTx(to common.Address, nonce ui
|
|||
func newTestWorker(t TensingObject, chainConfig *params.ChainConfig, engine consensus.Engine, db ethdb.Database, noempty bool, delay uint, opcodeDelay uint) (*worker, *testWorkerBackend, func()) {
|
||||
backend := newTestWorkerBackend(t, chainConfig, engine, db)
|
||||
backend.txPool.Add(pendingTxs, true, false)
|
||||
var w *worker
|
||||
w := newWorker(testConfig, chainConfig, engine, backend, new(event.TypeMux), nil, false)
|
||||
if delay != 0 || opcodeDelay != 0 {
|
||||
//nolint:staticcheck
|
||||
w = newWorkerWithDelay(testConfig, chainConfig, engine, backend, new(event.TypeMux), nil, false, delay, opcodeDelay)
|
||||
} else {
|
||||
//nolint:staticcheck
|
||||
w = newWorker(testConfig, chainConfig, engine, backend, new(event.TypeMux), nil, false)
|
||||
w.setInterruptCtx(vm.InterruptCtxDelayKey, delay)
|
||||
w.setInterruptCtx(vm.InterruptCtxOpcodeDelayKey, opcodeDelay)
|
||||
}
|
||||
w.setEtherbase(testBankAddress)
|
||||
// enable empty blocks
|
||||
|
|
@ -771,9 +768,7 @@ func testCommitInterruptExperimentBorContract(t *testing.T, delay uint, txCount
|
|||
}
|
||||
|
||||
wrapped := make([]*types.Transaction, len(txs))
|
||||
for i, tx := range txs {
|
||||
wrapped[i] = tx
|
||||
}
|
||||
copy(wrapped, txs)
|
||||
|
||||
b.TxPool().Add(wrapped, false, false)
|
||||
|
||||
|
|
@ -783,8 +778,9 @@ func testCommitInterruptExperimentBorContract(t *testing.T, delay uint, txCount
|
|||
w.stop()
|
||||
|
||||
currentBlockNumber := w.current.header.Number.Uint64()
|
||||
assert.Check(t, txCount >= w.chain.GetBlockByNumber(currentBlockNumber-1).Transactions().Len())
|
||||
assert.Check(t, 0 < w.chain.GetBlockByNumber(currentBlockNumber-1).Transactions().Len()+1)
|
||||
prevBlockTxCount := w.chain.GetBlockByNumber(currentBlockNumber - 1).Transactions().Len()
|
||||
assert.Check(t, prevBlockTxCount > 0)
|
||||
assert.Check(t, prevBlockTxCount <= txCount)
|
||||
}
|
||||
|
||||
// // nolint : thelper
|
||||
|
|
@ -973,7 +969,7 @@ func BenchmarkBorMiningBlockSTMMetadata(b *testing.B) {
|
|||
db2 := rawdb.NewMemoryDatabase()
|
||||
back.genesis.MustCommit(db2, triedb.NewDatabase(db2, triedb.HashDefaults))
|
||||
|
||||
chain, _ := core.NewParallelBlockChain(db2, nil, back.genesis, nil, engine, vm.Config{}, nil, nil, nil, 8)
|
||||
chain, _ := core.NewParallelBlockChain(db2, nil, back.genesis, nil, engine, vm.Config{}, nil, nil, nil, 8, false)
|
||||
defer chain.Stop()
|
||||
|
||||
// Ignore empty commit here for less noise.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ chain = "mainnet"
|
|||
# vmdebug = false
|
||||
datadir = "/var/lib/bor/data"
|
||||
# ancient = ""
|
||||
# "db.engine" = "leveldb"
|
||||
# "db.engine" = "pebble"
|
||||
state.scheme = "hash"
|
||||
# keystore = ""
|
||||
# "rpc.batchlimit" = 100
|
||||
# "rpc.returndatalimit" = 100000
|
||||
|
|
@ -37,10 +38,10 @@ gcmode = "archive"
|
|||
# [p2p.discovery]
|
||||
# v4disc = true
|
||||
# v5disc = false
|
||||
bootnodes = [ "enode://b8f1cc9c5d4403703fbf377116469667d2b1823c0daf16b7250aa576bacf399e42c3930ccfcb02c5df6879565a2b8931335565f0e8d3f8e72385ecf4a4bf160a@3.36.224.80:30303", "enode://8729e0c825f3d9cad382555f3e46dcff21af323e89025a0e6312df541f4a9e73abfa562d64906f5e59c51fe6f0501b3e61b07979606c56329c020ed739910759@54.194.245.5:30303" ]
|
||||
# bootnodesv4 = []
|
||||
# bootnodesv5 = []
|
||||
static-nodes = [ "enode://ad9180a1468702c7c6a7210544593b4bd444768ca754382d1da92fe9abaf408e58160dc72505936df63ca6afc3052e993cade199fe3ff067a5f11b0ee3c6e378@13.209.168.182:30303", "enode://7cf051238a3f92bbee811472a84592ab547ab2692ec09bd2104182551ca6de55f5a7cea48a3d36b411deccb4df976f27076d32019d9ccc4486a916c0e30f3a74@43.201.242.62:30303", "enode://40b4ad081f835ac974472cee8553a455be720263d45d091d395d747c6fa9b615c76e74afe8b9646cddde79ce5fa1dfbfda4d563ab58199681d100c5bbaf7be82@43.202.78.165:30303", "enode://a0da3a49d43404c12a1f350211f4a448cf6715eaa5667813e14e7af88a90820e6b2fb6fcc1a75b0207c19c98c4f6320b4c5c1bdeda408e1fa72710942d4ad6f6@3.38.254.221:30303", "enode://46feaae067017d18cc5c0dee365c970d5004d34e2cf65a82c051b16040b31b1a6714cc14aadc14d95b7c98cc5da3db1d3b8611e19f4ca4e8bee2b0498978c160@15.165.197.16:30303", "enode://fbf7edc7386abc991097687c699e80034518bd3ecc333b0718a49afdf34e93d4ddde377f7210dae4c8e7580e4901d6cbb82a043debe119b71a267c323c6c1ad6@52.78.154.236:30303", "enode://60572bb4659e41d9b2f0a06b2b7c4cf2a7517f2e5e4e49664974bf4c0f52630846f16f190818497d642dcc046698850b689d36d6a9dcd42e388a20e4a46a0de8@52.209.21.164:30303", "enode://71467975c9fbea1d1087693d7af1c8d12bc43029d52c9470b328f7cfe5252475f1886013ddc85ff880b0e7d26b4ce3e33566895ea95d67730e9d91daafbbab2d@99.81.158.129:30303", "enode://4bf816ccbdcd379e4623f65b42b91c18545c1721b58217cbd7258911418f5a112f1f1e01a6580d485844ac2635b3fa1cb6d6c0022319ee5c3a00388aad0b5279@34.254.124.45:30303", "enode://88a7d837d229ec20d9c5805ccb121e2580f2b8b92c3e8b669418addd34f36784ca20d68a672e24ae1daa8862480deed9d73c095b65baa0ce94a6290a1504fd27@34.252.116.193:30303", "enode://a1c1e190a397e351deda6c31faebbd45b459b11cb4ffe63fe894ca4b7860c3c2404ee888f8166c98906f4174c55a64d4f6a2955f6edf3de86d49a5c58e8e955f@54.76.109.39:30303", "enode://0e07395fb40ab63f4f13b0c5630eb94f72f5d4c4b04e5d2c91a1a950a9bfb504889ea9eb811cffb0df55b72883e20e6fde9aba14c9c5d1a48fae18ab3212a7ba@34.246.232.184:30303" ]
|
||||
bootnodes = [ "enode://e4fb013061eba9a2c6fb0a41bbd4149f4808f0fb7e88ec55d7163f19a6f02d64d0ce5ecc81528b769ba552a7068057432d44ab5e9e42842aff5b4709aa2c3f3b@34.89.75.187:30303", "enode://a49da6300403cf9b31e30502eb22c142ba4f77c9dda44990bccce9f2121c3152487ee95ee55c6b92d4cdce77845e40f59fd927da70ea91cf935b23e262236d75@34.142.43.249:30303" ]
|
||||
static-nodes = [ "enode://0e50fdcc2106b0c4e4d9ffbd7798ceda9432e680723dc7b7b4627e384078850c1c4a3e67f17ef2c484201ae6ee7c491cbf5e189b8ffee3948252e9bef59fc54e@35.234.148.172:30303", "enode://e4fb013061eba9a2c6fb0a41bbd4149f4808f0fb7e88ec55d7163f19a6f02d64d0ce5ecc81528b769ba552a7068057432d44ab5e9e42842aff5b4709aa2c3f3b@34.89.75.187:30303", "enode://a49da6300403cf9b31e30502eb22c142ba4f77c9dda44990bccce9f2121c3152487ee95ee55c6b92d4cdce77845e40f59fd927da70ea91cf935b23e262236d75@34.142.43.249:30303", "enode://a0bc4dd2b59370d5a375a7ef9ac06cf531571005ae8b2ead2e9aaeb8205168919b169451fb0ef7061e0d80592e6ed0720f559bd1be1c4efb6e6c4381f1bdb986@35.246.99.203:30303", "enode://f2b0d50e0b843d38ddcab59614f93065e2c82130100032f86ae193eb874505de12fcaf12502dfd88e339b817c0b374fa4b4f7c4d5a4d1aa04f29c503d95e0228@35.197.233.240:30303", "enode://72c3176693f7100dfedc8a37909120fea16971260a5d95ceff49affbc0e23968c35655fee75734736f0b038147645e8ceeee59af68859b3f5bf91fe249be6259@35.246.95.65:30303", "enode://f0e44769385aea31de930d3f4796e3e348962221063bb9f681106d832d13f70e5543d652d30e819812104f1b1ffdd7585977b46bf802ed5a52cf731de8c48dbd@34.105.180.11:30303", "enode://fc7624241515f9d5e599a396362c29de92b13a048ad361c90dd72286aa4cca835ba65e140a46ace70cc4dcb18472a476963750b3b69d958c5f546d48675880a8@34.147.169.102:30303", "enode://198896e373735ba38a0313d073137a413787ece791fbc0d0be0f9f6b9d9dd00ee0841f46519904d666d7f1cdfce5532b093e3a1574b34eb64224f57b9b7fce7b@34.89.55.74:30303" ]
|
||||
# trusted-nodes = []
|
||||
dns = [ "enrtree://AKUEZKN7PSKVNR65FZDHECMKOJQSGPARGTPPBI7WS2VUL4EGR6XPC@pos.polygon-peers.io" ]
|
||||
|
||||
|
|
@ -168,6 +169,11 @@ gcmode = "archive"
|
|||
# period = 0
|
||||
# gaslimit = 11500000
|
||||
|
||||
# [parallelevm]
|
||||
# enable = true
|
||||
# procs = 8
|
||||
# enforce = false
|
||||
|
||||
# [pprof]
|
||||
# pprof = false
|
||||
# port = 6060
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ chain = "mainnet"
|
|||
# vmdebug = false
|
||||
datadir = "/var/lib/bor/data"
|
||||
# ancient = ""
|
||||
# db.engine = "leveldb"
|
||||
# db.engine = "pebble"
|
||||
# keystore = ""
|
||||
# "rpc.batchlimit" = 100
|
||||
# "rpc.returndatalimit" = 100000
|
||||
|
|
@ -34,13 +34,13 @@ syncmode = "full"
|
|||
# nodekey = ""
|
||||
# nodekeyhex = ""
|
||||
# txarrivalwait = "500ms"
|
||||
# [p2p.discovery]
|
||||
[p2p.discovery]
|
||||
# v4disc = true
|
||||
# v5disc = false
|
||||
bootnodes = [ "enode://b8f1cc9c5d4403703fbf377116469667d2b1823c0daf16b7250aa576bacf399e42c3930ccfcb02c5df6879565a2b8931335565f0e8d3f8e72385ecf4a4bf160a@3.36.224.80:30303", "enode://8729e0c825f3d9cad382555f3e46dcff21af323e89025a0e6312df541f4a9e73abfa562d64906f5e59c51fe6f0501b3e61b07979606c56329c020ed739910759@54.194.245.5:30303" ]
|
||||
# bootnodesv4 = []
|
||||
# bootnodesv5 = []
|
||||
static-nodes = [ "enode://ad9180a1468702c7c6a7210544593b4bd444768ca754382d1da92fe9abaf408e58160dc72505936df63ca6afc3052e993cade199fe3ff067a5f11b0ee3c6e378@13.209.168.182:30303", "enode://7cf051238a3f92bbee811472a84592ab547ab2692ec09bd2104182551ca6de55f5a7cea48a3d36b411deccb4df976f27076d32019d9ccc4486a916c0e30f3a74@43.201.242.62:30303", "enode://40b4ad081f835ac974472cee8553a455be720263d45d091d395d747c6fa9b615c76e74afe8b9646cddde79ce5fa1dfbfda4d563ab58199681d100c5bbaf7be82@43.202.78.165:30303", "enode://a0da3a49d43404c12a1f350211f4a448cf6715eaa5667813e14e7af88a90820e6b2fb6fcc1a75b0207c19c98c4f6320b4c5c1bdeda408e1fa72710942d4ad6f6@3.38.254.221:30303", "enode://46feaae067017d18cc5c0dee365c970d5004d34e2cf65a82c051b16040b31b1a6714cc14aadc14d95b7c98cc5da3db1d3b8611e19f4ca4e8bee2b0498978c160@15.165.197.16:30303", "enode://fbf7edc7386abc991097687c699e80034518bd3ecc333b0718a49afdf34e93d4ddde377f7210dae4c8e7580e4901d6cbb82a043debe119b71a267c323c6c1ad6@52.78.154.236:30303", "enode://60572bb4659e41d9b2f0a06b2b7c4cf2a7517f2e5e4e49664974bf4c0f52630846f16f190818497d642dcc046698850b689d36d6a9dcd42e388a20e4a46a0de8@52.209.21.164:30303", "enode://71467975c9fbea1d1087693d7af1c8d12bc43029d52c9470b328f7cfe5252475f1886013ddc85ff880b0e7d26b4ce3e33566895ea95d67730e9d91daafbbab2d@99.81.158.129:30303", "enode://4bf816ccbdcd379e4623f65b42b91c18545c1721b58217cbd7258911418f5a112f1f1e01a6580d485844ac2635b3fa1cb6d6c0022319ee5c3a00388aad0b5279@34.254.124.45:30303", "enode://88a7d837d229ec20d9c5805ccb121e2580f2b8b92c3e8b669418addd34f36784ca20d68a672e24ae1daa8862480deed9d73c095b65baa0ce94a6290a1504fd27@34.252.116.193:30303", "enode://a1c1e190a397e351deda6c31faebbd45b459b11cb4ffe63fe894ca4b7860c3c2404ee888f8166c98906f4174c55a64d4f6a2955f6edf3de86d49a5c58e8e955f@54.76.109.39:30303", "enode://0e07395fb40ab63f4f13b0c5630eb94f72f5d4c4b04e5d2c91a1a950a9bfb504889ea9eb811cffb0df55b72883e20e6fde9aba14c9c5d1a48fae18ab3212a7ba@34.246.232.184:30303" ]
|
||||
bootnodes = [ "enode://e4fb013061eba9a2c6fb0a41bbd4149f4808f0fb7e88ec55d7163f19a6f02d64d0ce5ecc81528b769ba552a7068057432d44ab5e9e42842aff5b4709aa2c3f3b@34.89.75.187:30303", "enode://a49da6300403cf9b31e30502eb22c142ba4f77c9dda44990bccce9f2121c3152487ee95ee55c6b92d4cdce77845e40f59fd927da70ea91cf935b23e262236d75@34.142.43.249:30303" ]
|
||||
static-nodes = [ "enode://0e50fdcc2106b0c4e4d9ffbd7798ceda9432e680723dc7b7b4627e384078850c1c4a3e67f17ef2c484201ae6ee7c491cbf5e189b8ffee3948252e9bef59fc54e@35.234.148.172:30303", "enode://e4fb013061eba9a2c6fb0a41bbd4149f4808f0fb7e88ec55d7163f19a6f02d64d0ce5ecc81528b769ba552a7068057432d44ab5e9e42842aff5b4709aa2c3f3b@34.89.75.187:30303", "enode://a49da6300403cf9b31e30502eb22c142ba4f77c9dda44990bccce9f2121c3152487ee95ee55c6b92d4cdce77845e40f59fd927da70ea91cf935b23e262236d75@34.142.43.249:30303", "enode://a0bc4dd2b59370d5a375a7ef9ac06cf531571005ae8b2ead2e9aaeb8205168919b169451fb0ef7061e0d80592e6ed0720f559bd1be1c4efb6e6c4381f1bdb986@35.246.99.203:30303", "enode://f2b0d50e0b843d38ddcab59614f93065e2c82130100032f86ae193eb874505de12fcaf12502dfd88e339b817c0b374fa4b4f7c4d5a4d1aa04f29c503d95e0228@35.197.233.240:30303", "enode://72c3176693f7100dfedc8a37909120fea16971260a5d95ceff49affbc0e23968c35655fee75734736f0b038147645e8ceeee59af68859b3f5bf91fe249be6259@35.246.95.65:30303", "enode://f0e44769385aea31de930d3f4796e3e348962221063bb9f681106d832d13f70e5543d652d30e819812104f1b1ffdd7585977b46bf802ed5a52cf731de8c48dbd@34.105.180.11:30303", "enode://fc7624241515f9d5e599a396362c29de92b13a048ad361c90dd72286aa4cca835ba65e140a46ace70cc4dcb18472a476963750b3b69d958c5f546d48675880a8@34.147.169.102:30303", "enode://198896e373735ba38a0313d073137a413787ece791fbc0d0be0f9f6b9d9dd00ee0841f46519904d666d7f1cdfce5532b093e3a1574b34eb64224f57b9b7fce7b@34.89.55.74:30303" ]
|
||||
# trusted-nodes = ["<validator-ip>:<validator-p2p-port>"] # Recommended setting with sentry <> validator architecture
|
||||
dns = [ "enrtree://AKUEZKN7PSKVNR65FZDHECMKOJQSGPARGTPPBI7WS2VUL4EGR6XPC@pos.polygon-peers.io" ]
|
||||
|
||||
|
|
@ -168,6 +168,11 @@ syncmode = "full"
|
|||
# period = 0
|
||||
# gaslimit = 11500000
|
||||
|
||||
# [parallelevm]
|
||||
# enable = true
|
||||
# procs = 8
|
||||
# enforce = false
|
||||
|
||||
# [pprof]
|
||||
# pprof = false
|
||||
# port = 6060
|
||||
|
|
|
|||
|
|
@ -36,13 +36,13 @@ syncmode = "full"
|
|||
# nodekey = ""
|
||||
# nodekeyhex = ""
|
||||
# txarrivalwait = "500ms"
|
||||
# [p2p.discovery]
|
||||
[p2p.discovery]
|
||||
# v4disc = true
|
||||
# v5disc = false
|
||||
bootnodes = [ "enode://b8f1cc9c5d4403703fbf377116469667d2b1823c0daf16b7250aa576bacf399e42c3930ccfcb02c5df6879565a2b8931335565f0e8d3f8e72385ecf4a4bf160a@3.36.224.80:30303", "enode://8729e0c825f3d9cad382555f3e46dcff21af323e89025a0e6312df541f4a9e73abfa562d64906f5e59c51fe6f0501b3e61b07979606c56329c020ed739910759@54.194.245.5:30303" ]
|
||||
# bootnodesv4 = []
|
||||
# bootnodesv5 = []
|
||||
static-nodes = [ "enode://ad9180a1468702c7c6a7210544593b4bd444768ca754382d1da92fe9abaf408e58160dc72505936df63ca6afc3052e993cade199fe3ff067a5f11b0ee3c6e378@13.209.168.182:30303", "enode://7cf051238a3f92bbee811472a84592ab547ab2692ec09bd2104182551ca6de55f5a7cea48a3d36b411deccb4df976f27076d32019d9ccc4486a916c0e30f3a74@43.201.242.62:30303", "enode://40b4ad081f835ac974472cee8553a455be720263d45d091d395d747c6fa9b615c76e74afe8b9646cddde79ce5fa1dfbfda4d563ab58199681d100c5bbaf7be82@43.202.78.165:30303", "enode://a0da3a49d43404c12a1f350211f4a448cf6715eaa5667813e14e7af88a90820e6b2fb6fcc1a75b0207c19c98c4f6320b4c5c1bdeda408e1fa72710942d4ad6f6@3.38.254.221:30303", "enode://46feaae067017d18cc5c0dee365c970d5004d34e2cf65a82c051b16040b31b1a6714cc14aadc14d95b7c98cc5da3db1d3b8611e19f4ca4e8bee2b0498978c160@15.165.197.16:30303", "enode://fbf7edc7386abc991097687c699e80034518bd3ecc333b0718a49afdf34e93d4ddde377f7210dae4c8e7580e4901d6cbb82a043debe119b71a267c323c6c1ad6@52.78.154.236:30303", "enode://60572bb4659e41d9b2f0a06b2b7c4cf2a7517f2e5e4e49664974bf4c0f52630846f16f190818497d642dcc046698850b689d36d6a9dcd42e388a20e4a46a0de8@52.209.21.164:30303", "enode://71467975c9fbea1d1087693d7af1c8d12bc43029d52c9470b328f7cfe5252475f1886013ddc85ff880b0e7d26b4ce3e33566895ea95d67730e9d91daafbbab2d@99.81.158.129:30303", "enode://4bf816ccbdcd379e4623f65b42b91c18545c1721b58217cbd7258911418f5a112f1f1e01a6580d485844ac2635b3fa1cb6d6c0022319ee5c3a00388aad0b5279@34.254.124.45:30303", "enode://88a7d837d229ec20d9c5805ccb121e2580f2b8b92c3e8b669418addd34f36784ca20d68a672e24ae1daa8862480deed9d73c095b65baa0ce94a6290a1504fd27@34.252.116.193:30303", "enode://a1c1e190a397e351deda6c31faebbd45b459b11cb4ffe63fe894ca4b7860c3c2404ee888f8166c98906f4174c55a64d4f6a2955f6edf3de86d49a5c58e8e955f@54.76.109.39:30303", "enode://0e07395fb40ab63f4f13b0c5630eb94f72f5d4c4b04e5d2c91a1a950a9bfb504889ea9eb811cffb0df55b72883e20e6fde9aba14c9c5d1a48fae18ab3212a7ba@34.246.232.184:30303" ]
|
||||
bootnodes = [ "enode://e4fb013061eba9a2c6fb0a41bbd4149f4808f0fb7e88ec55d7163f19a6f02d64d0ce5ecc81528b769ba552a7068057432d44ab5e9e42842aff5b4709aa2c3f3b@34.89.75.187:30303", "enode://a49da6300403cf9b31e30502eb22c142ba4f77c9dda44990bccce9f2121c3152487ee95ee55c6b92d4cdce77845e40f59fd927da70ea91cf935b23e262236d75@34.142.43.249:30303" ]
|
||||
static-nodes = [ "enode://0e50fdcc2106b0c4e4d9ffbd7798ceda9432e680723dc7b7b4627e384078850c1c4a3e67f17ef2c484201ae6ee7c491cbf5e189b8ffee3948252e9bef59fc54e@35.234.148.172:30303", "enode://e4fb013061eba9a2c6fb0a41bbd4149f4808f0fb7e88ec55d7163f19a6f02d64d0ce5ecc81528b769ba552a7068057432d44ab5e9e42842aff5b4709aa2c3f3b@34.89.75.187:30303", "enode://a49da6300403cf9b31e30502eb22c142ba4f77c9dda44990bccce9f2121c3152487ee95ee55c6b92d4cdce77845e40f59fd927da70ea91cf935b23e262236d75@34.142.43.249:30303", "enode://a0bc4dd2b59370d5a375a7ef9ac06cf531571005ae8b2ead2e9aaeb8205168919b169451fb0ef7061e0d80592e6ed0720f559bd1be1c4efb6e6c4381f1bdb986@35.246.99.203:30303", "enode://f2b0d50e0b843d38ddcab59614f93065e2c82130100032f86ae193eb874505de12fcaf12502dfd88e339b817c0b374fa4b4f7c4d5a4d1aa04f29c503d95e0228@35.197.233.240:30303", "enode://72c3176693f7100dfedc8a37909120fea16971260a5d95ceff49affbc0e23968c35655fee75734736f0b038147645e8ceeee59af68859b3f5bf91fe249be6259@35.246.95.65:30303", "enode://f0e44769385aea31de930d3f4796e3e348962221063bb9f681106d832d13f70e5543d652d30e819812104f1b1ffdd7585977b46bf802ed5a52cf731de8c48dbd@34.105.180.11:30303", "enode://fc7624241515f9d5e599a396362c29de92b13a048ad361c90dd72286aa4cca835ba65e140a46ace70cc4dcb18472a476963750b3b69d958c5f546d48675880a8@34.147.169.102:30303", "enode://198896e373735ba38a0313d073137a413787ece791fbc0d0be0f9f6b9d9dd00ee0841f46519904d666d7f1cdfce5532b093e3a1574b34eb64224f57b9b7fce7b@34.89.55.74:30303" ]
|
||||
# trusted-nodes = ["<validator-ip>:<validator-p2p-port>"] # Recommended setting with sentry <> validator architecture
|
||||
dns = [ "enrtree://AKUEZKN7PSKVNR65FZDHECMKOJQSGPARGTPPBI7WS2VUL4EGR6XPC@pos.polygon-peers.io" ]
|
||||
|
||||
|
|
@ -170,6 +170,11 @@ syncmode = "full"
|
|||
# period = 0
|
||||
# gaslimit = 11500000
|
||||
|
||||
# [parallelevm]
|
||||
# enable = true
|
||||
# procs = 8
|
||||
# enforce = false
|
||||
|
||||
# [pprof]
|
||||
# pprof = false
|
||||
# port = 6060
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ chain = "mainnet"
|
|||
# vmdebug = false
|
||||
datadir = "/var/lib/bor/data"
|
||||
# ancient = ""
|
||||
# db.engine = "leveldb"
|
||||
# db.engine = "pebble"
|
||||
# keystore = "$BOR_DIR/keystore"
|
||||
# "rpc.batchlimit" = 100
|
||||
# "rpc.returndatalimit" = 100000
|
||||
|
|
@ -36,13 +36,13 @@ syncmode = "full"
|
|||
# nodekey = ""
|
||||
# nodekeyhex = ""
|
||||
# txarrivalwait = "500ms"
|
||||
# [p2p.discovery]
|
||||
[p2p.discovery]
|
||||
# v4disc = true
|
||||
# v5disc = false
|
||||
bootnodes = ["enode://b8f1cc9c5d4403703fbf377116469667d2b1823c0daf16b7250aa576bacf399e42c3930ccfcb02c5df6879565a2b8931335565f0e8d3f8e72385ecf4a4bf160a@3.36.224.80:30303", "enode://8729e0c825f3d9cad382555f3e46dcff21af323e89025a0e6312df541f4a9e73abfa562d64906f5e59c51fe6f0501b3e61b07979606c56329c020ed739910759@54.194.245.5:30303"]
|
||||
# bootnodesv4 = []
|
||||
# bootnodesv5 = []
|
||||
static-nodes = [ "enode://ad9180a1468702c7c6a7210544593b4bd444768ca754382d1da92fe9abaf408e58160dc72505936df63ca6afc3052e993cade199fe3ff067a5f11b0ee3c6e378@13.209.168.182:30303", "enode://7cf051238a3f92bbee811472a84592ab547ab2692ec09bd2104182551ca6de55f5a7cea48a3d36b411deccb4df976f27076d32019d9ccc4486a916c0e30f3a74@43.201.242.62:30303", "enode://40b4ad081f835ac974472cee8553a455be720263d45d091d395d747c6fa9b615c76e74afe8b9646cddde79ce5fa1dfbfda4d563ab58199681d100c5bbaf7be82@43.202.78.165:30303", "enode://a0da3a49d43404c12a1f350211f4a448cf6715eaa5667813e14e7af88a90820e6b2fb6fcc1a75b0207c19c98c4f6320b4c5c1bdeda408e1fa72710942d4ad6f6@3.38.254.221:30303", "enode://46feaae067017d18cc5c0dee365c970d5004d34e2cf65a82c051b16040b31b1a6714cc14aadc14d95b7c98cc5da3db1d3b8611e19f4ca4e8bee2b0498978c160@15.165.197.16:30303", "enode://fbf7edc7386abc991097687c699e80034518bd3ecc333b0718a49afdf34e93d4ddde377f7210dae4c8e7580e4901d6cbb82a043debe119b71a267c323c6c1ad6@52.78.154.236:30303", "enode://60572bb4659e41d9b2f0a06b2b7c4cf2a7517f2e5e4e49664974bf4c0f52630846f16f190818497d642dcc046698850b689d36d6a9dcd42e388a20e4a46a0de8@52.209.21.164:30303", "enode://71467975c9fbea1d1087693d7af1c8d12bc43029d52c9470b328f7cfe5252475f1886013ddc85ff880b0e7d26b4ce3e33566895ea95d67730e9d91daafbbab2d@99.81.158.129:30303", "enode://4bf816ccbdcd379e4623f65b42b91c18545c1721b58217cbd7258911418f5a112f1f1e01a6580d485844ac2635b3fa1cb6d6c0022319ee5c3a00388aad0b5279@34.254.124.45:30303", "enode://88a7d837d229ec20d9c5805ccb121e2580f2b8b92c3e8b669418addd34f36784ca20d68a672e24ae1daa8862480deed9d73c095b65baa0ce94a6290a1504fd27@34.252.116.193:30303", "enode://a1c1e190a397e351deda6c31faebbd45b459b11cb4ffe63fe894ca4b7860c3c2404ee888f8166c98906f4174c55a64d4f6a2955f6edf3de86d49a5c58e8e955f@54.76.109.39:30303", "enode://0e07395fb40ab63f4f13b0c5630eb94f72f5d4c4b04e5d2c91a1a950a9bfb504889ea9eb811cffb0df55b72883e20e6fde9aba14c9c5d1a48fae18ab3212a7ba@34.246.232.184:30303" ] # Recommended setting with sentry <> validator architecture
|
||||
bootnodes = [ "enode://e4fb013061eba9a2c6fb0a41bbd4149f4808f0fb7e88ec55d7163f19a6f02d64d0ce5ecc81528b769ba552a7068057432d44ab5e9e42842aff5b4709aa2c3f3b@34.89.75.187:30303", "enode://a49da6300403cf9b31e30502eb22c142ba4f77c9dda44990bccce9f2121c3152487ee95ee55c6b92d4cdce77845e40f59fd927da70ea91cf935b23e262236d75@34.142.43.249:30303" ]
|
||||
static-nodes = [ "enode://0e50fdcc2106b0c4e4d9ffbd7798ceda9432e680723dc7b7b4627e384078850c1c4a3e67f17ef2c484201ae6ee7c491cbf5e189b8ffee3948252e9bef59fc54e@35.234.148.172:30303", "enode://e4fb013061eba9a2c6fb0a41bbd4149f4808f0fb7e88ec55d7163f19a6f02d64d0ce5ecc81528b769ba552a7068057432d44ab5e9e42842aff5b4709aa2c3f3b@34.89.75.187:30303", "enode://a49da6300403cf9b31e30502eb22c142ba4f77c9dda44990bccce9f2121c3152487ee95ee55c6b92d4cdce77845e40f59fd927da70ea91cf935b23e262236d75@34.142.43.249:30303", "enode://a0bc4dd2b59370d5a375a7ef9ac06cf531571005ae8b2ead2e9aaeb8205168919b169451fb0ef7061e0d80592e6ed0720f559bd1be1c4efb6e6c4381f1bdb986@35.246.99.203:30303", "enode://f2b0d50e0b843d38ddcab59614f93065e2c82130100032f86ae193eb874505de12fcaf12502dfd88e339b817c0b374fa4b4f7c4d5a4d1aa04f29c503d95e0228@35.197.233.240:30303", "enode://72c3176693f7100dfedc8a37909120fea16971260a5d95ceff49affbc0e23968c35655fee75734736f0b038147645e8ceeee59af68859b3f5bf91fe249be6259@35.246.95.65:30303", "enode://f0e44769385aea31de930d3f4796e3e348962221063bb9f681106d832d13f70e5543d652d30e819812104f1b1ffdd7585977b46bf802ed5a52cf731de8c48dbd@34.105.180.11:30303", "enode://fc7624241515f9d5e599a396362c29de92b13a048ad361c90dd72286aa4cca835ba65e140a46ace70cc4dcb18472a476963750b3b69d958c5f546d48675880a8@34.147.169.102:30303", "enode://198896e373735ba38a0313d073137a413787ece791fbc0d0be0f9f6b9d9dd00ee0841f46519904d666d7f1cdfce5532b093e3a1574b34eb64224f57b9b7fce7b@34.89.55.74:30303" ]
|
||||
# trusted-nodes = []
|
||||
dns = [ "enrtree://AKUEZKN7PSKVNR65FZDHECMKOJQSGPARGTPPBI7WS2VUL4EGR6XPC@pos.polygon-peers.io" ]
|
||||
|
||||
|
|
@ -170,6 +170,11 @@ syncmode = "full"
|
|||
# period = 0
|
||||
# gaslimit = 11500000
|
||||
|
||||
# [parallelevm]
|
||||
# enable = true
|
||||
# procs = 8
|
||||
# enforce = false
|
||||
|
||||
# [pprof]
|
||||
# pprof = false
|
||||
# port = 6060
|
||||
|
|
|
|||
|
|
@ -38,13 +38,13 @@ syncmode = "full"
|
|||
# nodekey = ""
|
||||
# nodekeyhex = ""
|
||||
# txarrivalwait = "500ms"
|
||||
# [p2p.discovery]
|
||||
[p2p.discovery]
|
||||
# v4disc = true
|
||||
# v5disc = false
|
||||
bootnodes = ["enode://b8f1cc9c5d4403703fbf377116469667d2b1823c0daf16b7250aa576bacf399e42c3930ccfcb02c5df6879565a2b8931335565f0e8d3f8e72385ecf4a4bf160a@3.36.224.80:30303", "enode://8729e0c825f3d9cad382555f3e46dcff21af323e89025a0e6312df541f4a9e73abfa562d64906f5e59c51fe6f0501b3e61b07979606c56329c020ed739910759@54.194.245.5:30303"]
|
||||
# bootnodesv4 = []
|
||||
# bootnodesv5 = []
|
||||
static-nodes = [ "enode://ad9180a1468702c7c6a7210544593b4bd444768ca754382d1da92fe9abaf408e58160dc72505936df63ca6afc3052e993cade199fe3ff067a5f11b0ee3c6e378@13.209.168.182:30303", "enode://7cf051238a3f92bbee811472a84592ab547ab2692ec09bd2104182551ca6de55f5a7cea48a3d36b411deccb4df976f27076d32019d9ccc4486a916c0e30f3a74@43.201.242.62:30303", "enode://40b4ad081f835ac974472cee8553a455be720263d45d091d395d747c6fa9b615c76e74afe8b9646cddde79ce5fa1dfbfda4d563ab58199681d100c5bbaf7be82@43.202.78.165:30303", "enode://a0da3a49d43404c12a1f350211f4a448cf6715eaa5667813e14e7af88a90820e6b2fb6fcc1a75b0207c19c98c4f6320b4c5c1bdeda408e1fa72710942d4ad6f6@3.38.254.221:30303", "enode://46feaae067017d18cc5c0dee365c970d5004d34e2cf65a82c051b16040b31b1a6714cc14aadc14d95b7c98cc5da3db1d3b8611e19f4ca4e8bee2b0498978c160@15.165.197.16:30303", "enode://fbf7edc7386abc991097687c699e80034518bd3ecc333b0718a49afdf34e93d4ddde377f7210dae4c8e7580e4901d6cbb82a043debe119b71a267c323c6c1ad6@52.78.154.236:30303", "enode://60572bb4659e41d9b2f0a06b2b7c4cf2a7517f2e5e4e49664974bf4c0f52630846f16f190818497d642dcc046698850b689d36d6a9dcd42e388a20e4a46a0de8@52.209.21.164:30303", "enode://71467975c9fbea1d1087693d7af1c8d12bc43029d52c9470b328f7cfe5252475f1886013ddc85ff880b0e7d26b4ce3e33566895ea95d67730e9d91daafbbab2d@99.81.158.129:30303", "enode://4bf816ccbdcd379e4623f65b42b91c18545c1721b58217cbd7258911418f5a112f1f1e01a6580d485844ac2635b3fa1cb6d6c0022319ee5c3a00388aad0b5279@34.254.124.45:30303", "enode://88a7d837d229ec20d9c5805ccb121e2580f2b8b92c3e8b669418addd34f36784ca20d68a672e24ae1daa8862480deed9d73c095b65baa0ce94a6290a1504fd27@34.252.116.193:30303", "enode://a1c1e190a397e351deda6c31faebbd45b459b11cb4ffe63fe894ca4b7860c3c2404ee888f8166c98906f4174c55a64d4f6a2955f6edf3de86d49a5c58e8e955f@54.76.109.39:30303", "enode://0e07395fb40ab63f4f13b0c5630eb94f72f5d4c4b04e5d2c91a1a950a9bfb504889ea9eb811cffb0df55b72883e20e6fde9aba14c9c5d1a48fae18ab3212a7ba@34.246.232.184:30303" ] # Recommended setting with sentry <> validator architecture
|
||||
bootnodes = [ "enode://e4fb013061eba9a2c6fb0a41bbd4149f4808f0fb7e88ec55d7163f19a6f02d64d0ce5ecc81528b769ba552a7068057432d44ab5e9e42842aff5b4709aa2c3f3b@34.89.75.187:30303", "enode://a49da6300403cf9b31e30502eb22c142ba4f77c9dda44990bccce9f2121c3152487ee95ee55c6b92d4cdce77845e40f59fd927da70ea91cf935b23e262236d75@34.142.43.249:30303" ]
|
||||
static-nodes = [ "enode://0e50fdcc2106b0c4e4d9ffbd7798ceda9432e680723dc7b7b4627e384078850c1c4a3e67f17ef2c484201ae6ee7c491cbf5e189b8ffee3948252e9bef59fc54e@35.234.148.172:30303", "enode://e4fb013061eba9a2c6fb0a41bbd4149f4808f0fb7e88ec55d7163f19a6f02d64d0ce5ecc81528b769ba552a7068057432d44ab5e9e42842aff5b4709aa2c3f3b@34.89.75.187:30303", "enode://a49da6300403cf9b31e30502eb22c142ba4f77c9dda44990bccce9f2121c3152487ee95ee55c6b92d4cdce77845e40f59fd927da70ea91cf935b23e262236d75@34.142.43.249:30303", "enode://a0bc4dd2b59370d5a375a7ef9ac06cf531571005ae8b2ead2e9aaeb8205168919b169451fb0ef7061e0d80592e6ed0720f559bd1be1c4efb6e6c4381f1bdb986@35.246.99.203:30303", "enode://f2b0d50e0b843d38ddcab59614f93065e2c82130100032f86ae193eb874505de12fcaf12502dfd88e339b817c0b374fa4b4f7c4d5a4d1aa04f29c503d95e0228@35.197.233.240:30303", "enode://72c3176693f7100dfedc8a37909120fea16971260a5d95ceff49affbc0e23968c35655fee75734736f0b038147645e8ceeee59af68859b3f5bf91fe249be6259@35.246.95.65:30303", "enode://f0e44769385aea31de930d3f4796e3e348962221063bb9f681106d832d13f70e5543d652d30e819812104f1b1ffdd7585977b46bf802ed5a52cf731de8c48dbd@34.105.180.11:30303", "enode://fc7624241515f9d5e599a396362c29de92b13a048ad361c90dd72286aa4cca835ba65e140a46ace70cc4dcb18472a476963750b3b69d958c5f546d48675880a8@34.147.169.102:30303", "enode://198896e373735ba38a0313d073137a413787ece791fbc0d0be0f9f6b9d9dd00ee0841f46519904d666d7f1cdfce5532b093e3a1574b34eb64224f57b9b7fce7b@34.89.55.74:30303" ]
|
||||
# trusted-nodes = []
|
||||
dns = [ "enrtree://AKUEZKN7PSKVNR65FZDHECMKOJQSGPARGTPPBI7WS2VUL4EGR6XPC@pos.polygon-peers.io" ]
|
||||
|
||||
|
|
@ -172,6 +172,11 @@ syncmode = "full"
|
|||
# period = 0
|
||||
# gaslimit = 11500000
|
||||
|
||||
# [parallelevm]
|
||||
# enable = true
|
||||
# procs = 8
|
||||
# enforce = false
|
||||
|
||||
# [pprof]
|
||||
# pprof = false
|
||||
# port = 6060
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ chain = "mainnet"
|
|||
# vmdebug = false
|
||||
datadir = "/var/lib/bor/data"
|
||||
# ancient = ""
|
||||
# db.engine = "leveldb"
|
||||
# db.engine = "pebble"
|
||||
# keystore = "$BOR_DIR/keystore"
|
||||
# "rpc.batchlimit" = 100
|
||||
# "rpc.returndatalimit" = 100000
|
||||
|
|
@ -36,13 +36,13 @@ syncmode = "full"
|
|||
# nodekey = ""
|
||||
# nodekeyhex = ""
|
||||
# txarrivalwait = "500ms"
|
||||
# [p2p.discovery]
|
||||
[p2p.discovery]
|
||||
# v4disc = true
|
||||
# v5disc = false
|
||||
bootnodes = [ "enode://b8f1cc9c5d4403703fbf377116469667d2b1823c0daf16b7250aa576bacf399e42c3930ccfcb02c5df6879565a2b8931335565f0e8d3f8e72385ecf4a4bf160a@3.36.224.80:30303", "enode://8729e0c825f3d9cad382555f3e46dcff21af323e89025a0e6312df541f4a9e73abfa562d64906f5e59c51fe6f0501b3e61b07979606c56329c020ed739910759@54.194.245.5:30303" ]
|
||||
# bootnodesv4 = []
|
||||
# bootnodesv5 = []
|
||||
static-nodes = [ "enode://ad9180a1468702c7c6a7210544593b4bd444768ca754382d1da92fe9abaf408e58160dc72505936df63ca6afc3052e993cade199fe3ff067a5f11b0ee3c6e378@13.209.168.182:30303", "enode://7cf051238a3f92bbee811472a84592ab547ab2692ec09bd2104182551ca6de55f5a7cea48a3d36b411deccb4df976f27076d32019d9ccc4486a916c0e30f3a74@43.201.242.62:30303", "enode://40b4ad081f835ac974472cee8553a455be720263d45d091d395d747c6fa9b615c76e74afe8b9646cddde79ce5fa1dfbfda4d563ab58199681d100c5bbaf7be82@43.202.78.165:30303", "enode://a0da3a49d43404c12a1f350211f4a448cf6715eaa5667813e14e7af88a90820e6b2fb6fcc1a75b0207c19c98c4f6320b4c5c1bdeda408e1fa72710942d4ad6f6@3.38.254.221:30303", "enode://46feaae067017d18cc5c0dee365c970d5004d34e2cf65a82c051b16040b31b1a6714cc14aadc14d95b7c98cc5da3db1d3b8611e19f4ca4e8bee2b0498978c160@15.165.197.16:30303", "enode://fbf7edc7386abc991097687c699e80034518bd3ecc333b0718a49afdf34e93d4ddde377f7210dae4c8e7580e4901d6cbb82a043debe119b71a267c323c6c1ad6@52.78.154.236:30303", "enode://60572bb4659e41d9b2f0a06b2b7c4cf2a7517f2e5e4e49664974bf4c0f52630846f16f190818497d642dcc046698850b689d36d6a9dcd42e388a20e4a46a0de8@52.209.21.164:30303", "enode://71467975c9fbea1d1087693d7af1c8d12bc43029d52c9470b328f7cfe5252475f1886013ddc85ff880b0e7d26b4ce3e33566895ea95d67730e9d91daafbbab2d@99.81.158.129:30303", "enode://4bf816ccbdcd379e4623f65b42b91c18545c1721b58217cbd7258911418f5a112f1f1e01a6580d485844ac2635b3fa1cb6d6c0022319ee5c3a00388aad0b5279@34.254.124.45:30303", "enode://88a7d837d229ec20d9c5805ccb121e2580f2b8b92c3e8b669418addd34f36784ca20d68a672e24ae1daa8862480deed9d73c095b65baa0ce94a6290a1504fd27@34.252.116.193:30303", "enode://a1c1e190a397e351deda6c31faebbd45b459b11cb4ffe63fe894ca4b7860c3c2404ee888f8166c98906f4174c55a64d4f6a2955f6edf3de86d49a5c58e8e955f@54.76.109.39:30303", "enode://0e07395fb40ab63f4f13b0c5630eb94f72f5d4c4b04e5d2c91a1a950a9bfb504889ea9eb811cffb0df55b72883e20e6fde9aba14c9c5d1a48fae18ab3212a7ba@34.246.232.184:30303" ]
|
||||
bootnodes = [ "enode://e4fb013061eba9a2c6fb0a41bbd4149f4808f0fb7e88ec55d7163f19a6f02d64d0ce5ecc81528b769ba552a7068057432d44ab5e9e42842aff5b4709aa2c3f3b@34.89.75.187:30303", "enode://a49da6300403cf9b31e30502eb22c142ba4f77c9dda44990bccce9f2121c3152487ee95ee55c6b92d4cdce77845e40f59fd927da70ea91cf935b23e262236d75@34.142.43.249:30303" ]
|
||||
static-nodes = [ "enode://0e50fdcc2106b0c4e4d9ffbd7798ceda9432e680723dc7b7b4627e384078850c1c4a3e67f17ef2c484201ae6ee7c491cbf5e189b8ffee3948252e9bef59fc54e@35.234.148.172:30303", "enode://e4fb013061eba9a2c6fb0a41bbd4149f4808f0fb7e88ec55d7163f19a6f02d64d0ce5ecc81528b769ba552a7068057432d44ab5e9e42842aff5b4709aa2c3f3b@34.89.75.187:30303", "enode://a49da6300403cf9b31e30502eb22c142ba4f77c9dda44990bccce9f2121c3152487ee95ee55c6b92d4cdce77845e40f59fd927da70ea91cf935b23e262236d75@34.142.43.249:30303", "enode://a0bc4dd2b59370d5a375a7ef9ac06cf531571005ae8b2ead2e9aaeb8205168919b169451fb0ef7061e0d80592e6ed0720f559bd1be1c4efb6e6c4381f1bdb986@35.246.99.203:30303", "enode://f2b0d50e0b843d38ddcab59614f93065e2c82130100032f86ae193eb874505de12fcaf12502dfd88e339b817c0b374fa4b4f7c4d5a4d1aa04f29c503d95e0228@35.197.233.240:30303", "enode://72c3176693f7100dfedc8a37909120fea16971260a5d95ceff49affbc0e23968c35655fee75734736f0b038147645e8ceeee59af68859b3f5bf91fe249be6259@35.246.95.65:30303", "enode://f0e44769385aea31de930d3f4796e3e348962221063bb9f681106d832d13f70e5543d652d30e819812104f1b1ffdd7585977b46bf802ed5a52cf731de8c48dbd@34.105.180.11:30303", "enode://fc7624241515f9d5e599a396362c29de92b13a048ad361c90dd72286aa4cca835ba65e140a46ace70cc4dcb18472a476963750b3b69d958c5f546d48675880a8@34.147.169.102:30303", "enode://198896e373735ba38a0313d073137a413787ece791fbc0d0be0f9f6b9d9dd00ee0841f46519904d666d7f1cdfce5532b093e3a1574b34eb64224f57b9b7fce7b@34.89.55.74:30303" ]
|
||||
# trusted-nodes = []
|
||||
dns = [ "enrtree://AKUEZKN7PSKVNR65FZDHECMKOJQSGPARGTPPBI7WS2VUL4EGR6XPC@pos.polygon-peers.io" ]
|
||||
|
||||
|
|
@ -170,6 +170,11 @@ syncmode = "full"
|
|||
# period = 0
|
||||
# gaslimit = 11500000
|
||||
|
||||
# [parallelevm]
|
||||
# enable = true
|
||||
# procs = 8
|
||||
# enforce = false
|
||||
|
||||
# [pprof]
|
||||
# pprof = false
|
||||
# port = 6060
|
||||
|
|
|
|||
|
|
@ -37,13 +37,13 @@ syncmode = "full"
|
|||
# nodekey = ""
|
||||
# nodekeyhex = ""
|
||||
# txarrivalwait = "500ms"
|
||||
# [p2p.discovery]
|
||||
[p2p.discovery]
|
||||
# v4disc = true
|
||||
# v5disc = false
|
||||
bootnodes = [ "enode://b8f1cc9c5d4403703fbf377116469667d2b1823c0daf16b7250aa576bacf399e42c3930ccfcb02c5df6879565a2b8931335565f0e8d3f8e72385ecf4a4bf160a@3.36.224.80:30303", "enode://8729e0c825f3d9cad382555f3e46dcff21af323e89025a0e6312df541f4a9e73abfa562d64906f5e59c51fe6f0501b3e61b07979606c56329c020ed739910759@54.194.245.5:30303" ]
|
||||
# bootnodesv4 = []
|
||||
# bootnodesv5 = []
|
||||
static-nodes = [ "enode://ad9180a1468702c7c6a7210544593b4bd444768ca754382d1da92fe9abaf408e58160dc72505936df63ca6afc3052e993cade199fe3ff067a5f11b0ee3c6e378@13.209.168.182:30303", "enode://7cf051238a3f92bbee811472a84592ab547ab2692ec09bd2104182551ca6de55f5a7cea48a3d36b411deccb4df976f27076d32019d9ccc4486a916c0e30f3a74@43.201.242.62:30303", "enode://40b4ad081f835ac974472cee8553a455be720263d45d091d395d747c6fa9b615c76e74afe8b9646cddde79ce5fa1dfbfda4d563ab58199681d100c5bbaf7be82@43.202.78.165:30303", "enode://a0da3a49d43404c12a1f350211f4a448cf6715eaa5667813e14e7af88a90820e6b2fb6fcc1a75b0207c19c98c4f6320b4c5c1bdeda408e1fa72710942d4ad6f6@3.38.254.221:30303", "enode://46feaae067017d18cc5c0dee365c970d5004d34e2cf65a82c051b16040b31b1a6714cc14aadc14d95b7c98cc5da3db1d3b8611e19f4ca4e8bee2b0498978c160@15.165.197.16:30303", "enode://fbf7edc7386abc991097687c699e80034518bd3ecc333b0718a49afdf34e93d4ddde377f7210dae4c8e7580e4901d6cbb82a043debe119b71a267c323c6c1ad6@52.78.154.236:30303", "enode://60572bb4659e41d9b2f0a06b2b7c4cf2a7517f2e5e4e49664974bf4c0f52630846f16f190818497d642dcc046698850b689d36d6a9dcd42e388a20e4a46a0de8@52.209.21.164:30303", "enode://71467975c9fbea1d1087693d7af1c8d12bc43029d52c9470b328f7cfe5252475f1886013ddc85ff880b0e7d26b4ce3e33566895ea95d67730e9d91daafbbab2d@99.81.158.129:30303", "enode://4bf816ccbdcd379e4623f65b42b91c18545c1721b58217cbd7258911418f5a112f1f1e01a6580d485844ac2635b3fa1cb6d6c0022319ee5c3a00388aad0b5279@34.254.124.45:30303", "enode://88a7d837d229ec20d9c5805ccb121e2580f2b8b92c3e8b669418addd34f36784ca20d68a672e24ae1daa8862480deed9d73c095b65baa0ce94a6290a1504fd27@34.252.116.193:30303", "enode://a1c1e190a397e351deda6c31faebbd45b459b11cb4ffe63fe894ca4b7860c3c2404ee888f8166c98906f4174c55a64d4f6a2955f6edf3de86d49a5c58e8e955f@54.76.109.39:30303", "enode://0e07395fb40ab63f4f13b0c5630eb94f72f5d4c4b04e5d2c91a1a950a9bfb504889ea9eb811cffb0df55b72883e20e6fde9aba14c9c5d1a48fae18ab3212a7ba@34.246.232.184:30303" ]
|
||||
bootnodes = [ "enode://e4fb013061eba9a2c6fb0a41bbd4149f4808f0fb7e88ec55d7163f19a6f02d64d0ce5ecc81528b769ba552a7068057432d44ab5e9e42842aff5b4709aa2c3f3b@34.89.75.187:30303", "enode://a49da6300403cf9b31e30502eb22c142ba4f77c9dda44990bccce9f2121c3152487ee95ee55c6b92d4cdce77845e40f59fd927da70ea91cf935b23e262236d75@34.142.43.249:30303" ]
|
||||
static-nodes = [ "enode://0e50fdcc2106b0c4e4d9ffbd7798ceda9432e680723dc7b7b4627e384078850c1c4a3e67f17ef2c484201ae6ee7c491cbf5e189b8ffee3948252e9bef59fc54e@35.234.148.172:30303", "enode://e4fb013061eba9a2c6fb0a41bbd4149f4808f0fb7e88ec55d7163f19a6f02d64d0ce5ecc81528b769ba552a7068057432d44ab5e9e42842aff5b4709aa2c3f3b@34.89.75.187:30303", "enode://a49da6300403cf9b31e30502eb22c142ba4f77c9dda44990bccce9f2121c3152487ee95ee55c6b92d4cdce77845e40f59fd927da70ea91cf935b23e262236d75@34.142.43.249:30303", "enode://a0bc4dd2b59370d5a375a7ef9ac06cf531571005ae8b2ead2e9aaeb8205168919b169451fb0ef7061e0d80592e6ed0720f559bd1be1c4efb6e6c4381f1bdb986@35.246.99.203:30303", "enode://f2b0d50e0b843d38ddcab59614f93065e2c82130100032f86ae193eb874505de12fcaf12502dfd88e339b817c0b374fa4b4f7c4d5a4d1aa04f29c503d95e0228@35.197.233.240:30303", "enode://72c3176693f7100dfedc8a37909120fea16971260a5d95ceff49affbc0e23968c35655fee75734736f0b038147645e8ceeee59af68859b3f5bf91fe249be6259@35.246.95.65:30303", "enode://f0e44769385aea31de930d3f4796e3e348962221063bb9f681106d832d13f70e5543d652d30e819812104f1b1ffdd7585977b46bf802ed5a52cf731de8c48dbd@34.105.180.11:30303", "enode://fc7624241515f9d5e599a396362c29de92b13a048ad361c90dd72286aa4cca835ba65e140a46ace70cc4dcb18472a476963750b3b69d958c5f546d48675880a8@34.147.169.102:30303", "enode://198896e373735ba38a0313d073137a413787ece791fbc0d0be0f9f6b9d9dd00ee0841f46519904d666d7f1cdfce5532b093e3a1574b34eb64224f57b9b7fce7b@34.89.55.74:30303" ]
|
||||
# trusted-nodes = []
|
||||
dns = [ "enrtree://AKUEZKN7PSKVNR65FZDHECMKOJQSGPARGTPPBI7WS2VUL4EGR6XPC@pos.polygon-peers.io" ]
|
||||
|
||||
|
|
@ -171,6 +171,11 @@ syncmode = "full"
|
|||
# period = 0
|
||||
# gaslimit = 11500000
|
||||
|
||||
# [parallelevm]
|
||||
# enable = true
|
||||
# procs = 8
|
||||
# enforce = false
|
||||
|
||||
# [pprof]
|
||||
# pprof = false
|
||||
# port = 6060
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ chain = "amoy"
|
|||
# vmdebug = false
|
||||
datadir = "/var/lib/bor/data"
|
||||
# ancient = ""
|
||||
# db.engine = "leveldb"
|
||||
# db.engine = "pebble"
|
||||
state.scheme = "hash"
|
||||
# keystore = ""
|
||||
# "rpc.batchlimit" = 100
|
||||
# "rpc.returndatalimit" = 100000
|
||||
|
|
@ -33,14 +34,14 @@ gcmode = "archive"
|
|||
# nodekey = ""
|
||||
# nodekeyhex = ""
|
||||
# txarrivalwait = "500ms"
|
||||
# [p2p.discovery]
|
||||
[p2p.discovery]
|
||||
# v5disc = false
|
||||
# bootnodesv4 = []
|
||||
# bootnodesv5 = []
|
||||
bootnodes = [ "enode://bce861be777e91b0a5a49d58a51e14f32f201b4c6c2d1fbea6c7a1f14756cbb3f931f3188d6b65de8b07b53ff28d03b6e366d09e56360d2124a9fc5a15a0913d@54.217.171.196:30303", "enode://4a3dc0081a346d26a73d79dd88216a9402d2292318e2db9947dbc97ea9c4afb2498dc519c0af04420dc13a238c279062da0320181e7c1461216ce4513bfd40bf@13.251.184.185:30303" ]
|
||||
static-nodes = [ "enode://383ec39eb7f7e23538ea846f502602632110a6bcfc7521bfc2b8833f5a190779507d006b28650d83674b75d188cb36bcb3c3e168a0f2b3d98f9a651cc6603146@52.214.229.208:30303", "enode://bce861be777e91b0a5a49d58a51e14f32f201b4c6c2d1fbea6c7a1f14756cbb3f931f3188d6b65de8b07b53ff28d03b6e366d09e56360d2124a9fc5a15a0913d@54.217.171.196:30303", "enode://a4a387ad423a2fd0d652808b270082250d3c616b7e8537209584ebad4806dd50ef8dc66a371c85c7f55e6c1f53747edbb11055c8073cfacf312047eaeb328f58@54.171.220.164:30303", "enode://4a3dc0081a346d26a73d79dd88216a9402d2292318e2db9947dbc97ea9c4afb2498dc519c0af04420dc13a238c279062da0320181e7c1461216ce4513bfd40bf@13.251.184.185:30303", "enode://e8fe33b52f90d4bc7a4e75800945df449d1a091bd347c9f11cd1dbcd98ea28cb4c231cb3b1c6feacdabca2aa91f1a6744724b44edc9382c107968792abdef261@52.74.18.182:30303", "enode://b240f1f18e8f3cc61df96a164ba215ea6fc3f00717e4300da6283362a0438bda53f81ecc24c575ff130066d42096319fa027c952681bbb4f003e0bdd5d5b4e61@52.76.37.145:30303", "enode://de55d16b6e1fca28cdd3d11eb0dd89e3b77b96d4722172bd5e04ac255922324076a87748e97bc021af2307dccbb5ef8062389cfcba1845f77219eee7935dea9f@52.74.125.36:30303", "enode://7f2272685fc3e31c8e43c7687dda43ea3192fd310ba01efcb7811d5dc7ad5a64402ea8cd827650e573a174cf29bb69331dffcca6f0b9894ef17eeafabd97a41d@47.128.184.10:30303", "enode://c66e12243b425b63528dd8b1ce87f2f7fbc85f35485e2d8bf6bbf0ec0dcd05b3a582ef62daadbde061b58058735788335d09ed972a451242b9943b85d323c239@63.32.214.97:30303", "enode://bd56c0f00dd37e14ae2b84f5eb50e357d3a2d326bdbb0cbb987411268b3f132288f6c86157fc132c6902d18b9be0de8bbdcd12d926e16232ebadd8e274aae780@52.208.81.179:30303", "enode://2f015d5b1571165975382281a2117a9b514e1b38e87a8116596fc9b3b121a93cfb238eb6f7b3ae30cf9c0154384372745ce9edc09cbc30526ab7e2059f57ddee@54.74.160.230:30303" ]
|
||||
bootnodes = [ "enode://0ef8758cafc0063405f3f31fe22f2a3b566aa871bd7cd405e35954ec8aa7237c21e1ccc1f65f1b6099ab36db029362bc2fecf001a771b3d9803bbf1968508cef@35.197.249.21:30303", "enode://c9c8c18cde48b41d46ced0c564496aef721a9b58f8724025a0b1f3f26f1b826f31786f890f8f8781e18b16dbb3c7bff805c7304d1273ac11630ed25a3f0dc41c@34.89.39.114:30303" ]
|
||||
static-nodes = [ "enode://0ef8758cafc0063405f3f31fe22f2a3b566aa871bd7cd405e35954ec8aa7237c21e1ccc1f65f1b6099ab36db029362bc2fecf001a771b3d9803bbf1968508cef@35.197.249.21:30303", "enode://c9c8c18cde48b41d46ced0c564496aef721a9b58f8724025a0b1f3f26f1b826f31786f890f8f8781e18b16dbb3c7bff805c7304d1273ac11630ed25a3f0dc41c@34.89.39.114:30303", "enode://5b8d436677fb545b1c3fd1ae84553d478d9d21ad3b06a908b9d34d2df367ead5bb8823d84a370e26bdde8896ba8a870e21ba3a6dce19c0ded086296df5f04f15@35.242.167.175:30303", "enode://5bd810da4f021a974e80cf2be48975d58cafbcfdd971d568ab98250f8568a9457bdc1b7a6d16b5aebfcb9deb0c1ec612f0664d5366c74f5266906a2774dd70f0@34.89.15.223:30303", "enode://a2ec3671e553ba3e711639033912be55fe1e7fa4b61a93f6a1ac0cd3cea34f9d7eec1d718e04049531cf5dd7efc1ac677df1cf0e1f24f5e677706d7bcb3917de@34.105.128.110:30303", "enode://9e15bc58779c32119140d54a8384940b57a10a001506ce173cc4cdb10876b14a2ac9ae91f9389caf9fd385c3b72825f8bbbe937e7e57b1f032561703e900da59@34.89.21.99:30303", "enode://42203e9b423aba24e1e9386f94d0d0397a42770427e8e9e22f9e2a9523f66abb13b1f5a6addee68ad5986f94a8f6de626f5829492599a2f9484f98e86e26149d@34.89.101.16:30303", "enode://83c235bb4305ecdd5addcbfd09478d2df7cddca9b7eed3ef11b2426fad04ccfe7335279e2371a85696e461dcbe78de6912d07043a912dbd85cb0bb944d78b8d9@34.89.11.233:30303" ]
|
||||
# trusted-nodes = []
|
||||
# dns = []
|
||||
dns = [ "enrtree://AKUEZKN7PSKVNR65FZDHECMKOJQSGPARGTPPBI7WS2VUL4EGR6XPC@amoy.polygon-peers.io" ]
|
||||
|
||||
# [heimdall]
|
||||
# url = "http://localhost:1317"
|
||||
|
|
@ -167,6 +168,11 @@ gcmode = "archive"
|
|||
# period = 0
|
||||
# gaslimit = 11500000
|
||||
|
||||
# [parallelevm]
|
||||
# enable = true
|
||||
# procs = 8
|
||||
# enforce = false
|
||||
|
||||
# [pprof]
|
||||
# pprof = false
|
||||
# port = 6060
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ chain = "amoy"
|
|||
# vmdebug = false
|
||||
datadir = "/var/lib/bor/data"
|
||||
# ancient = ""
|
||||
# db.engine = "leveldb"
|
||||
# db.engine = "pebble"
|
||||
# keystore = ""
|
||||
# "rpc.batchlimit" = 100
|
||||
# "rpc.returndatalimit" = 100000
|
||||
|
|
@ -33,14 +33,14 @@ syncmode = "full"
|
|||
# nodekey = ""
|
||||
# nodekeyhex = ""
|
||||
# txarrivalwait = "500ms"
|
||||
# [p2p.discovery]
|
||||
[p2p.discovery]
|
||||
# v5disc = false
|
||||
# bootnodesv4 = []
|
||||
# bootnodesv5 = []
|
||||
bootnodes = [ "enode://bce861be777e91b0a5a49d58a51e14f32f201b4c6c2d1fbea6c7a1f14756cbb3f931f3188d6b65de8b07b53ff28d03b6e366d09e56360d2124a9fc5a15a0913d@54.217.171.196:30303", "enode://4a3dc0081a346d26a73d79dd88216a9402d2292318e2db9947dbc97ea9c4afb2498dc519c0af04420dc13a238c279062da0320181e7c1461216ce4513bfd40bf@13.251.184.185:30303" ]
|
||||
static-nodes = [ "enode://383ec39eb7f7e23538ea846f502602632110a6bcfc7521bfc2b8833f5a190779507d006b28650d83674b75d188cb36bcb3c3e168a0f2b3d98f9a651cc6603146@52.214.229.208:30303", "enode://bce861be777e91b0a5a49d58a51e14f32f201b4c6c2d1fbea6c7a1f14756cbb3f931f3188d6b65de8b07b53ff28d03b6e366d09e56360d2124a9fc5a15a0913d@54.217.171.196:30303", "enode://a4a387ad423a2fd0d652808b270082250d3c616b7e8537209584ebad4806dd50ef8dc66a371c85c7f55e6c1f53747edbb11055c8073cfacf312047eaeb328f58@54.171.220.164:30303", "enode://4a3dc0081a346d26a73d79dd88216a9402d2292318e2db9947dbc97ea9c4afb2498dc519c0af04420dc13a238c279062da0320181e7c1461216ce4513bfd40bf@13.251.184.185:30303", "enode://e8fe33b52f90d4bc7a4e75800945df449d1a091bd347c9f11cd1dbcd98ea28cb4c231cb3b1c6feacdabca2aa91f1a6744724b44edc9382c107968792abdef261@52.74.18.182:30303", "enode://b240f1f18e8f3cc61df96a164ba215ea6fc3f00717e4300da6283362a0438bda53f81ecc24c575ff130066d42096319fa027c952681bbb4f003e0bdd5d5b4e61@52.76.37.145:30303", "enode://de55d16b6e1fca28cdd3d11eb0dd89e3b77b96d4722172bd5e04ac255922324076a87748e97bc021af2307dccbb5ef8062389cfcba1845f77219eee7935dea9f@52.74.125.36:30303", "enode://7f2272685fc3e31c8e43c7687dda43ea3192fd310ba01efcb7811d5dc7ad5a64402ea8cd827650e573a174cf29bb69331dffcca6f0b9894ef17eeafabd97a41d@47.128.184.10:30303", "enode://c66e12243b425b63528dd8b1ce87f2f7fbc85f35485e2d8bf6bbf0ec0dcd05b3a582ef62daadbde061b58058735788335d09ed972a451242b9943b85d323c239@63.32.214.97:30303", "enode://bd56c0f00dd37e14ae2b84f5eb50e357d3a2d326bdbb0cbb987411268b3f132288f6c86157fc132c6902d18b9be0de8bbdcd12d926e16232ebadd8e274aae780@52.208.81.179:30303", "enode://2f015d5b1571165975382281a2117a9b514e1b38e87a8116596fc9b3b121a93cfb238eb6f7b3ae30cf9c0154384372745ce9edc09cbc30526ab7e2059f57ddee@54.74.160.230:30303" ]
|
||||
bootnodes = [ "enode://0ef8758cafc0063405f3f31fe22f2a3b566aa871bd7cd405e35954ec8aa7237c21e1ccc1f65f1b6099ab36db029362bc2fecf001a771b3d9803bbf1968508cef@35.197.249.21:30303", "enode://c9c8c18cde48b41d46ced0c564496aef721a9b58f8724025a0b1f3f26f1b826f31786f890f8f8781e18b16dbb3c7bff805c7304d1273ac11630ed25a3f0dc41c@34.89.39.114:30303" ]
|
||||
static-nodes = [ "enode://0ef8758cafc0063405f3f31fe22f2a3b566aa871bd7cd405e35954ec8aa7237c21e1ccc1f65f1b6099ab36db029362bc2fecf001a771b3d9803bbf1968508cef@35.197.249.21:30303", "enode://c9c8c18cde48b41d46ced0c564496aef721a9b58f8724025a0b1f3f26f1b826f31786f890f8f8781e18b16dbb3c7bff805c7304d1273ac11630ed25a3f0dc41c@34.89.39.114:30303", "enode://5b8d436677fb545b1c3fd1ae84553d478d9d21ad3b06a908b9d34d2df367ead5bb8823d84a370e26bdde8896ba8a870e21ba3a6dce19c0ded086296df5f04f15@35.242.167.175:30303", "enode://5bd810da4f021a974e80cf2be48975d58cafbcfdd971d568ab98250f8568a9457bdc1b7a6d16b5aebfcb9deb0c1ec612f0664d5366c74f5266906a2774dd70f0@34.89.15.223:30303", "enode://a2ec3671e553ba3e711639033912be55fe1e7fa4b61a93f6a1ac0cd3cea34f9d7eec1d718e04049531cf5dd7efc1ac677df1cf0e1f24f5e677706d7bcb3917de@34.105.128.110:30303", "enode://9e15bc58779c32119140d54a8384940b57a10a001506ce173cc4cdb10876b14a2ac9ae91f9389caf9fd385c3b72825f8bbbe937e7e57b1f032561703e900da59@34.89.21.99:30303", "enode://42203e9b423aba24e1e9386f94d0d0397a42770427e8e9e22f9e2a9523f66abb13b1f5a6addee68ad5986f94a8f6de626f5829492599a2f9484f98e86e26149d@34.89.101.16:30303", "enode://83c235bb4305ecdd5addcbfd09478d2df7cddca9b7eed3ef11b2426fad04ccfe7335279e2371a85696e461dcbe78de6912d07043a912dbd85cb0bb944d78b8d9@34.89.11.233:30303" ]
|
||||
# trusted-nodes = []
|
||||
# dns = []
|
||||
dns = [ "enrtree://AKUEZKN7PSKVNR65FZDHECMKOJQSGPARGTPPBI7WS2VUL4EGR6XPC@amoy.polygon-peers.io" ]
|
||||
|
||||
# [heimdall]
|
||||
# url = "http://localhost:1317"
|
||||
|
|
@ -167,6 +167,11 @@ syncmode = "full"
|
|||
# period = 0
|
||||
# gaslimit = 11500000
|
||||
|
||||
# [parallelevm]
|
||||
# enable = true
|
||||
# procs = 8
|
||||
# enforce = false
|
||||
|
||||
# [pprof]
|
||||
# pprof = false
|
||||
# port = 6060
|
||||
|
|
|
|||
|
|
@ -34,14 +34,14 @@ syncmode = "full"
|
|||
# nodekey = ""
|
||||
# nodekeyhex = ""
|
||||
# txarrivalwait = "500ms"
|
||||
# [p2p.discovery]
|
||||
[p2p.discovery]
|
||||
# v5disc = false
|
||||
# bootnodesv4 = []
|
||||
# bootnodesv5 = []
|
||||
bootnodes = [ "enode://bce861be777e91b0a5a49d58a51e14f32f201b4c6c2d1fbea6c7a1f14756cbb3f931f3188d6b65de8b07b53ff28d03b6e366d09e56360d2124a9fc5a15a0913d@54.217.171.196:30303", "enode://4a3dc0081a346d26a73d79dd88216a9402d2292318e2db9947dbc97ea9c4afb2498dc519c0af04420dc13a238c279062da0320181e7c1461216ce4513bfd40bf@13.251.184.185:30303" ]
|
||||
static-nodes = [ "enode://383ec39eb7f7e23538ea846f502602632110a6bcfc7521bfc2b8833f5a190779507d006b28650d83674b75d188cb36bcb3c3e168a0f2b3d98f9a651cc6603146@52.214.229.208:30303", "enode://bce861be777e91b0a5a49d58a51e14f32f201b4c6c2d1fbea6c7a1f14756cbb3f931f3188d6b65de8b07b53ff28d03b6e366d09e56360d2124a9fc5a15a0913d@54.217.171.196:30303", "enode://a4a387ad423a2fd0d652808b270082250d3c616b7e8537209584ebad4806dd50ef8dc66a371c85c7f55e6c1f53747edbb11055c8073cfacf312047eaeb328f58@54.171.220.164:30303", "enode://4a3dc0081a346d26a73d79dd88216a9402d2292318e2db9947dbc97ea9c4afb2498dc519c0af04420dc13a238c279062da0320181e7c1461216ce4513bfd40bf@13.251.184.185:30303", "enode://e8fe33b52f90d4bc7a4e75800945df449d1a091bd347c9f11cd1dbcd98ea28cb4c231cb3b1c6feacdabca2aa91f1a6744724b44edc9382c107968792abdef261@52.74.18.182:30303", "enode://b240f1f18e8f3cc61df96a164ba215ea6fc3f00717e4300da6283362a0438bda53f81ecc24c575ff130066d42096319fa027c952681bbb4f003e0bdd5d5b4e61@52.76.37.145:30303", "enode://de55d16b6e1fca28cdd3d11eb0dd89e3b77b96d4722172bd5e04ac255922324076a87748e97bc021af2307dccbb5ef8062389cfcba1845f77219eee7935dea9f@52.74.125.36:30303", "enode://7f2272685fc3e31c8e43c7687dda43ea3192fd310ba01efcb7811d5dc7ad5a64402ea8cd827650e573a174cf29bb69331dffcca6f0b9894ef17eeafabd97a41d@47.128.184.10:30303", "enode://c66e12243b425b63528dd8b1ce87f2f7fbc85f35485e2d8bf6bbf0ec0dcd05b3a582ef62daadbde061b58058735788335d09ed972a451242b9943b85d323c239@63.32.214.97:30303", "enode://bd56c0f00dd37e14ae2b84f5eb50e357d3a2d326bdbb0cbb987411268b3f132288f6c86157fc132c6902d18b9be0de8bbdcd12d926e16232ebadd8e274aae780@52.208.81.179:30303", "enode://2f015d5b1571165975382281a2117a9b514e1b38e87a8116596fc9b3b121a93cfb238eb6f7b3ae30cf9c0154384372745ce9edc09cbc30526ab7e2059f57ddee@54.74.160.230:30303" ]
|
||||
bootnodes = [ "enode://0ef8758cafc0063405f3f31fe22f2a3b566aa871bd7cd405e35954ec8aa7237c21e1ccc1f65f1b6099ab36db029362bc2fecf001a771b3d9803bbf1968508cef@35.197.249.21:30303", "enode://c9c8c18cde48b41d46ced0c564496aef721a9b58f8724025a0b1f3f26f1b826f31786f890f8f8781e18b16dbb3c7bff805c7304d1273ac11630ed25a3f0dc41c@34.89.39.114:30303" ]
|
||||
static-nodes = [ "enode://0ef8758cafc0063405f3f31fe22f2a3b566aa871bd7cd405e35954ec8aa7237c21e1ccc1f65f1b6099ab36db029362bc2fecf001a771b3d9803bbf1968508cef@35.197.249.21:30303", "enode://c9c8c18cde48b41d46ced0c564496aef721a9b58f8724025a0b1f3f26f1b826f31786f890f8f8781e18b16dbb3c7bff805c7304d1273ac11630ed25a3f0dc41c@34.89.39.114:30303", "enode://5b8d436677fb545b1c3fd1ae84553d478d9d21ad3b06a908b9d34d2df367ead5bb8823d84a370e26bdde8896ba8a870e21ba3a6dce19c0ded086296df5f04f15@35.242.167.175:30303", "enode://5bd810da4f021a974e80cf2be48975d58cafbcfdd971d568ab98250f8568a9457bdc1b7a6d16b5aebfcb9deb0c1ec612f0664d5366c74f5266906a2774dd70f0@34.89.15.223:30303", "enode://a2ec3671e553ba3e711639033912be55fe1e7fa4b61a93f6a1ac0cd3cea34f9d7eec1d718e04049531cf5dd7efc1ac677df1cf0e1f24f5e677706d7bcb3917de@34.105.128.110:30303", "enode://9e15bc58779c32119140d54a8384940b57a10a001506ce173cc4cdb10876b14a2ac9ae91f9389caf9fd385c3b72825f8bbbe937e7e57b1f032561703e900da59@34.89.21.99:30303", "enode://42203e9b423aba24e1e9386f94d0d0397a42770427e8e9e22f9e2a9523f66abb13b1f5a6addee68ad5986f94a8f6de626f5829492599a2f9484f98e86e26149d@34.89.101.16:30303", "enode://83c235bb4305ecdd5addcbfd09478d2df7cddca9b7eed3ef11b2426fad04ccfe7335279e2371a85696e461dcbe78de6912d07043a912dbd85cb0bb944d78b8d9@34.89.11.233:30303" ]
|
||||
# trusted-nodes = []
|
||||
# dns = []
|
||||
dns = [ "enrtree://AKUEZKN7PSKVNR65FZDHECMKOJQSGPARGTPPBI7WS2VUL4EGR6XPC@amoy.polygon-peers.io" ]
|
||||
|
||||
# [heimdall]
|
||||
# url = "http://localhost:1317"
|
||||
|
|
@ -168,6 +168,11 @@ syncmode = "full"
|
|||
# period = 0
|
||||
# gaslimit = 11500000
|
||||
|
||||
# [parallelevm]
|
||||
# enable = true
|
||||
# procs = 8
|
||||
# enforce = false
|
||||
|
||||
# [pprof]
|
||||
# pprof = false
|
||||
# port = 6060
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ chain = "amoy"
|
|||
# vmdebug = false
|
||||
datadir = "/var/lib/bor/data"
|
||||
# ancient = ""
|
||||
# db.engine = "leveldb"
|
||||
# db.engine = "pebble"
|
||||
# keystore = "$BOR_DIR/keystore"
|
||||
# "rpc.batchlimit" = 100
|
||||
# "rpc.returndatalimit" = 100000
|
||||
|
|
@ -35,14 +35,14 @@ syncmode = "full"
|
|||
# nodekey = ""
|
||||
# nodekeyhex = ""
|
||||
# txarrivalwait = "500ms"
|
||||
# [p2p.discovery]
|
||||
[p2p.discovery]
|
||||
# v5disc = false
|
||||
# bootnodesv4 = []
|
||||
# bootnodesv5 = []
|
||||
bootnodes = [ "enode://bce861be777e91b0a5a49d58a51e14f32f201b4c6c2d1fbea6c7a1f14756cbb3f931f3188d6b65de8b07b53ff28d03b6e366d09e56360d2124a9fc5a15a0913d@54.217.171.196:30303", "enode://4a3dc0081a346d26a73d79dd88216a9402d2292318e2db9947dbc97ea9c4afb2498dc519c0af04420dc13a238c279062da0320181e7c1461216ce4513bfd40bf@13.251.184.185:30303" ]
|
||||
static-nodes = [ "enode://383ec39eb7f7e23538ea846f502602632110a6bcfc7521bfc2b8833f5a190779507d006b28650d83674b75d188cb36bcb3c3e168a0f2b3d98f9a651cc6603146@52.214.229.208:30303", "enode://bce861be777e91b0a5a49d58a51e14f32f201b4c6c2d1fbea6c7a1f14756cbb3f931f3188d6b65de8b07b53ff28d03b6e366d09e56360d2124a9fc5a15a0913d@54.217.171.196:30303", "enode://a4a387ad423a2fd0d652808b270082250d3c616b7e8537209584ebad4806dd50ef8dc66a371c85c7f55e6c1f53747edbb11055c8073cfacf312047eaeb328f58@54.171.220.164:30303", "enode://4a3dc0081a346d26a73d79dd88216a9402d2292318e2db9947dbc97ea9c4afb2498dc519c0af04420dc13a238c279062da0320181e7c1461216ce4513bfd40bf@13.251.184.185:30303", "enode://e8fe33b52f90d4bc7a4e75800945df449d1a091bd347c9f11cd1dbcd98ea28cb4c231cb3b1c6feacdabca2aa91f1a6744724b44edc9382c107968792abdef261@52.74.18.182:30303", "enode://b240f1f18e8f3cc61df96a164ba215ea6fc3f00717e4300da6283362a0438bda53f81ecc24c575ff130066d42096319fa027c952681bbb4f003e0bdd5d5b4e61@52.76.37.145:30303", "enode://de55d16b6e1fca28cdd3d11eb0dd89e3b77b96d4722172bd5e04ac255922324076a87748e97bc021af2307dccbb5ef8062389cfcba1845f77219eee7935dea9f@52.74.125.36:30303", "enode://7f2272685fc3e31c8e43c7687dda43ea3192fd310ba01efcb7811d5dc7ad5a64402ea8cd827650e573a174cf29bb69331dffcca6f0b9894ef17eeafabd97a41d@47.128.184.10:30303", "enode://c66e12243b425b63528dd8b1ce87f2f7fbc85f35485e2d8bf6bbf0ec0dcd05b3a582ef62daadbde061b58058735788335d09ed972a451242b9943b85d323c239@63.32.214.97:30303", "enode://bd56c0f00dd37e14ae2b84f5eb50e357d3a2d326bdbb0cbb987411268b3f132288f6c86157fc132c6902d18b9be0de8bbdcd12d926e16232ebadd8e274aae780@52.208.81.179:30303", "enode://2f015d5b1571165975382281a2117a9b514e1b38e87a8116596fc9b3b121a93cfb238eb6f7b3ae30cf9c0154384372745ce9edc09cbc30526ab7e2059f57ddee@54.74.160.230:30303" ]
|
||||
bootnodes = [ "enode://0ef8758cafc0063405f3f31fe22f2a3b566aa871bd7cd405e35954ec8aa7237c21e1ccc1f65f1b6099ab36db029362bc2fecf001a771b3d9803bbf1968508cef@35.197.249.21:30303", "enode://c9c8c18cde48b41d46ced0c564496aef721a9b58f8724025a0b1f3f26f1b826f31786f890f8f8781e18b16dbb3c7bff805c7304d1273ac11630ed25a3f0dc41c@34.89.39.114:30303" ]
|
||||
static-nodes = [ "enode://0ef8758cafc0063405f3f31fe22f2a3b566aa871bd7cd405e35954ec8aa7237c21e1ccc1f65f1b6099ab36db029362bc2fecf001a771b3d9803bbf1968508cef@35.197.249.21:30303", "enode://c9c8c18cde48b41d46ced0c564496aef721a9b58f8724025a0b1f3f26f1b826f31786f890f8f8781e18b16dbb3c7bff805c7304d1273ac11630ed25a3f0dc41c@34.89.39.114:30303", "enode://5b8d436677fb545b1c3fd1ae84553d478d9d21ad3b06a908b9d34d2df367ead5bb8823d84a370e26bdde8896ba8a870e21ba3a6dce19c0ded086296df5f04f15@35.242.167.175:30303", "enode://5bd810da4f021a974e80cf2be48975d58cafbcfdd971d568ab98250f8568a9457bdc1b7a6d16b5aebfcb9deb0c1ec612f0664d5366c74f5266906a2774dd70f0@34.89.15.223:30303", "enode://a2ec3671e553ba3e711639033912be55fe1e7fa4b61a93f6a1ac0cd3cea34f9d7eec1d718e04049531cf5dd7efc1ac677df1cf0e1f24f5e677706d7bcb3917de@34.105.128.110:30303", "enode://9e15bc58779c32119140d54a8384940b57a10a001506ce173cc4cdb10876b14a2ac9ae91f9389caf9fd385c3b72825f8bbbe937e7e57b1f032561703e900da59@34.89.21.99:30303", "enode://42203e9b423aba24e1e9386f94d0d0397a42770427e8e9e22f9e2a9523f66abb13b1f5a6addee68ad5986f94a8f6de626f5829492599a2f9484f98e86e26149d@34.89.101.16:30303", "enode://83c235bb4305ecdd5addcbfd09478d2df7cddca9b7eed3ef11b2426fad04ccfe7335279e2371a85696e461dcbe78de6912d07043a912dbd85cb0bb944d78b8d9@34.89.11.233:30303" ]
|
||||
# trusted-nodes = []
|
||||
# dns = []
|
||||
dns = [ "enrtree://AKUEZKN7PSKVNR65FZDHECMKOJQSGPARGTPPBI7WS2VUL4EGR6XPC@amoy.polygon-peers.io" ]
|
||||
|
||||
# [heimdall]
|
||||
# url = "http://localhost:1317"
|
||||
|
|
@ -169,6 +169,11 @@ syncmode = "full"
|
|||
# period = 0
|
||||
# gaslimit = 11500000
|
||||
|
||||
# [parallelevm]
|
||||
# enable = true
|
||||
# procs = 8
|
||||
# enforce = false
|
||||
|
||||
# pprof = false
|
||||
# port = 6060
|
||||
# addr = "127.0.0.1"
|
||||
|
|
|
|||
|
|
@ -36,14 +36,14 @@ syncmode = "full"
|
|||
# nodekey = ""
|
||||
# nodekeyhex = ""
|
||||
# txarrivalwait = "500ms"
|
||||
# [p2p.discovery]
|
||||
[p2p.discovery]
|
||||
# v5disc = false
|
||||
# bootnodesv4 = []
|
||||
# bootnodesv5 = []
|
||||
bootnodes = [ "enode://bce861be777e91b0a5a49d58a51e14f32f201b4c6c2d1fbea6c7a1f14756cbb3f931f3188d6b65de8b07b53ff28d03b6e366d09e56360d2124a9fc5a15a0913d@54.217.171.196:30303", "enode://4a3dc0081a346d26a73d79dd88216a9402d2292318e2db9947dbc97ea9c4afb2498dc519c0af04420dc13a238c279062da0320181e7c1461216ce4513bfd40bf@13.251.184.185:30303" ]
|
||||
static-nodes = [ "enode://383ec39eb7f7e23538ea846f502602632110a6bcfc7521bfc2b8833f5a190779507d006b28650d83674b75d188cb36bcb3c3e168a0f2b3d98f9a651cc6603146@52.214.229.208:30303", "enode://bce861be777e91b0a5a49d58a51e14f32f201b4c6c2d1fbea6c7a1f14756cbb3f931f3188d6b65de8b07b53ff28d03b6e366d09e56360d2124a9fc5a15a0913d@54.217.171.196:30303", "enode://a4a387ad423a2fd0d652808b270082250d3c616b7e8537209584ebad4806dd50ef8dc66a371c85c7f55e6c1f53747edbb11055c8073cfacf312047eaeb328f58@54.171.220.164:30303", "enode://4a3dc0081a346d26a73d79dd88216a9402d2292318e2db9947dbc97ea9c4afb2498dc519c0af04420dc13a238c279062da0320181e7c1461216ce4513bfd40bf@13.251.184.185:30303", "enode://e8fe33b52f90d4bc7a4e75800945df449d1a091bd347c9f11cd1dbcd98ea28cb4c231cb3b1c6feacdabca2aa91f1a6744724b44edc9382c107968792abdef261@52.74.18.182:30303", "enode://b240f1f18e8f3cc61df96a164ba215ea6fc3f00717e4300da6283362a0438bda53f81ecc24c575ff130066d42096319fa027c952681bbb4f003e0bdd5d5b4e61@52.76.37.145:30303", "enode://de55d16b6e1fca28cdd3d11eb0dd89e3b77b96d4722172bd5e04ac255922324076a87748e97bc021af2307dccbb5ef8062389cfcba1845f77219eee7935dea9f@52.74.125.36:30303", "enode://7f2272685fc3e31c8e43c7687dda43ea3192fd310ba01efcb7811d5dc7ad5a64402ea8cd827650e573a174cf29bb69331dffcca6f0b9894ef17eeafabd97a41d@47.128.184.10:30303", "enode://c66e12243b425b63528dd8b1ce87f2f7fbc85f35485e2d8bf6bbf0ec0dcd05b3a582ef62daadbde061b58058735788335d09ed972a451242b9943b85d323c239@63.32.214.97:30303", "enode://bd56c0f00dd37e14ae2b84f5eb50e357d3a2d326bdbb0cbb987411268b3f132288f6c86157fc132c6902d18b9be0de8bbdcd12d926e16232ebadd8e274aae780@52.208.81.179:30303", "enode://2f015d5b1571165975382281a2117a9b514e1b38e87a8116596fc9b3b121a93cfb238eb6f7b3ae30cf9c0154384372745ce9edc09cbc30526ab7e2059f57ddee@54.74.160.230:30303" ]
|
||||
bootnodes = [ "enode://0ef8758cafc0063405f3f31fe22f2a3b566aa871bd7cd405e35954ec8aa7237c21e1ccc1f65f1b6099ab36db029362bc2fecf001a771b3d9803bbf1968508cef@35.197.249.21:30303", "enode://c9c8c18cde48b41d46ced0c564496aef721a9b58f8724025a0b1f3f26f1b826f31786f890f8f8781e18b16dbb3c7bff805c7304d1273ac11630ed25a3f0dc41c@34.89.39.114:30303" ]
|
||||
static-nodes = [ "enode://0ef8758cafc0063405f3f31fe22f2a3b566aa871bd7cd405e35954ec8aa7237c21e1ccc1f65f1b6099ab36db029362bc2fecf001a771b3d9803bbf1968508cef@35.197.249.21:30303", "enode://c9c8c18cde48b41d46ced0c564496aef721a9b58f8724025a0b1f3f26f1b826f31786f890f8f8781e18b16dbb3c7bff805c7304d1273ac11630ed25a3f0dc41c@34.89.39.114:30303", "enode://5b8d436677fb545b1c3fd1ae84553d478d9d21ad3b06a908b9d34d2df367ead5bb8823d84a370e26bdde8896ba8a870e21ba3a6dce19c0ded086296df5f04f15@35.242.167.175:30303", "enode://5bd810da4f021a974e80cf2be48975d58cafbcfdd971d568ab98250f8568a9457bdc1b7a6d16b5aebfcb9deb0c1ec612f0664d5366c74f5266906a2774dd70f0@34.89.15.223:30303", "enode://a2ec3671e553ba3e711639033912be55fe1e7fa4b61a93f6a1ac0cd3cea34f9d7eec1d718e04049531cf5dd7efc1ac677df1cf0e1f24f5e677706d7bcb3917de@34.105.128.110:30303", "enode://9e15bc58779c32119140d54a8384940b57a10a001506ce173cc4cdb10876b14a2ac9ae91f9389caf9fd385c3b72825f8bbbe937e7e57b1f032561703e900da59@34.89.21.99:30303", "enode://42203e9b423aba24e1e9386f94d0d0397a42770427e8e9e22f9e2a9523f66abb13b1f5a6addee68ad5986f94a8f6de626f5829492599a2f9484f98e86e26149d@34.89.101.16:30303", "enode://83c235bb4305ecdd5addcbfd09478d2df7cddca9b7eed3ef11b2426fad04ccfe7335279e2371a85696e461dcbe78de6912d07043a912dbd85cb0bb944d78b8d9@34.89.11.233:30303" ]
|
||||
# trusted-nodes = []
|
||||
# dns = []
|
||||
dns = [ "enrtree://AKUEZKN7PSKVNR65FZDHECMKOJQSGPARGTPPBI7WS2VUL4EGR6XPC@amoy.polygon-peers.io" ]
|
||||
|
||||
# [heimdall]
|
||||
# url = "http://localhost:1317"
|
||||
|
|
@ -170,6 +170,11 @@ syncmode = "full"
|
|||
# period = 0
|
||||
# gaslimit = 11500000
|
||||
|
||||
# [parallelevm]
|
||||
# enable = true
|
||||
# procs = 8
|
||||
# enforce = false
|
||||
|
||||
# pprof = false
|
||||
# port = 6060
|
||||
# addr = "127.0.0.1"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ chain = "amoy"
|
|||
# vmdebug = false
|
||||
datadir = "/var/lib/bor/data"
|
||||
# ancient = ""
|
||||
# db.engine = "leveldb"
|
||||
# db.engine = "pebble"
|
||||
# keystore = "$BOR_DIR/keystore"
|
||||
# "rpc.batchlimit" = 100
|
||||
# "rpc.returndatalimit" = 100000
|
||||
|
|
@ -35,14 +35,14 @@ syncmode = "full"
|
|||
# nodekey = ""
|
||||
# nodekeyhex = ""
|
||||
# txarrivalwait = "500ms"
|
||||
# [p2p.discovery]
|
||||
[p2p.discovery]
|
||||
# v5disc = false
|
||||
# bootnodesv4 = []
|
||||
# bootnodesv5 = []
|
||||
bootnodes = [ "enode://bce861be777e91b0a5a49d58a51e14f32f201b4c6c2d1fbea6c7a1f14756cbb3f931f3188d6b65de8b07b53ff28d03b6e366d09e56360d2124a9fc5a15a0913d@54.217.171.196:30303", "enode://4a3dc0081a346d26a73d79dd88216a9402d2292318e2db9947dbc97ea9c4afb2498dc519c0af04420dc13a238c279062da0320181e7c1461216ce4513bfd40bf@13.251.184.185:30303" ]
|
||||
static-nodes = [ "enode://383ec39eb7f7e23538ea846f502602632110a6bcfc7521bfc2b8833f5a190779507d006b28650d83674b75d188cb36bcb3c3e168a0f2b3d98f9a651cc6603146@52.214.229.208:30303", "enode://bce861be777e91b0a5a49d58a51e14f32f201b4c6c2d1fbea6c7a1f14756cbb3f931f3188d6b65de8b07b53ff28d03b6e366d09e56360d2124a9fc5a15a0913d@54.217.171.196:30303", "enode://a4a387ad423a2fd0d652808b270082250d3c616b7e8537209584ebad4806dd50ef8dc66a371c85c7f55e6c1f53747edbb11055c8073cfacf312047eaeb328f58@54.171.220.164:30303", "enode://4a3dc0081a346d26a73d79dd88216a9402d2292318e2db9947dbc97ea9c4afb2498dc519c0af04420dc13a238c279062da0320181e7c1461216ce4513bfd40bf@13.251.184.185:30303", "enode://e8fe33b52f90d4bc7a4e75800945df449d1a091bd347c9f11cd1dbcd98ea28cb4c231cb3b1c6feacdabca2aa91f1a6744724b44edc9382c107968792abdef261@52.74.18.182:30303", "enode://b240f1f18e8f3cc61df96a164ba215ea6fc3f00717e4300da6283362a0438bda53f81ecc24c575ff130066d42096319fa027c952681bbb4f003e0bdd5d5b4e61@52.76.37.145:30303", "enode://de55d16b6e1fca28cdd3d11eb0dd89e3b77b96d4722172bd5e04ac255922324076a87748e97bc021af2307dccbb5ef8062389cfcba1845f77219eee7935dea9f@52.74.125.36:30303", "enode://7f2272685fc3e31c8e43c7687dda43ea3192fd310ba01efcb7811d5dc7ad5a64402ea8cd827650e573a174cf29bb69331dffcca6f0b9894ef17eeafabd97a41d@47.128.184.10:30303", "enode://c66e12243b425b63528dd8b1ce87f2f7fbc85f35485e2d8bf6bbf0ec0dcd05b3a582ef62daadbde061b58058735788335d09ed972a451242b9943b85d323c239@63.32.214.97:30303", "enode://bd56c0f00dd37e14ae2b84f5eb50e357d3a2d326bdbb0cbb987411268b3f132288f6c86157fc132c6902d18b9be0de8bbdcd12d926e16232ebadd8e274aae780@52.208.81.179:30303", "enode://2f015d5b1571165975382281a2117a9b514e1b38e87a8116596fc9b3b121a93cfb238eb6f7b3ae30cf9c0154384372745ce9edc09cbc30526ab7e2059f57ddee@54.74.160.230:30303" ]
|
||||
bootnodes = [ "enode://0ef8758cafc0063405f3f31fe22f2a3b566aa871bd7cd405e35954ec8aa7237c21e1ccc1f65f1b6099ab36db029362bc2fecf001a771b3d9803bbf1968508cef@35.197.249.21:30303", "enode://c9c8c18cde48b41d46ced0c564496aef721a9b58f8724025a0b1f3f26f1b826f31786f890f8f8781e18b16dbb3c7bff805c7304d1273ac11630ed25a3f0dc41c@34.89.39.114:30303" ]
|
||||
static-nodes = [ "enode://0ef8758cafc0063405f3f31fe22f2a3b566aa871bd7cd405e35954ec8aa7237c21e1ccc1f65f1b6099ab36db029362bc2fecf001a771b3d9803bbf1968508cef@35.197.249.21:30303", "enode://c9c8c18cde48b41d46ced0c564496aef721a9b58f8724025a0b1f3f26f1b826f31786f890f8f8781e18b16dbb3c7bff805c7304d1273ac11630ed25a3f0dc41c@34.89.39.114:30303", "enode://5b8d436677fb545b1c3fd1ae84553d478d9d21ad3b06a908b9d34d2df367ead5bb8823d84a370e26bdde8896ba8a870e21ba3a6dce19c0ded086296df5f04f15@35.242.167.175:30303", "enode://5bd810da4f021a974e80cf2be48975d58cafbcfdd971d568ab98250f8568a9457bdc1b7a6d16b5aebfcb9deb0c1ec612f0664d5366c74f5266906a2774dd70f0@34.89.15.223:30303", "enode://a2ec3671e553ba3e711639033912be55fe1e7fa4b61a93f6a1ac0cd3cea34f9d7eec1d718e04049531cf5dd7efc1ac677df1cf0e1f24f5e677706d7bcb3917de@34.105.128.110:30303", "enode://9e15bc58779c32119140d54a8384940b57a10a001506ce173cc4cdb10876b14a2ac9ae91f9389caf9fd385c3b72825f8bbbe937e7e57b1f032561703e900da59@34.89.21.99:30303", "enode://42203e9b423aba24e1e9386f94d0d0397a42770427e8e9e22f9e2a9523f66abb13b1f5a6addee68ad5986f94a8f6de626f5829492599a2f9484f98e86e26149d@34.89.101.16:30303", "enode://83c235bb4305ecdd5addcbfd09478d2df7cddca9b7eed3ef11b2426fad04ccfe7335279e2371a85696e461dcbe78de6912d07043a912dbd85cb0bb944d78b8d9@34.89.11.233:30303" ]
|
||||
# trusted-nodes = []
|
||||
# dns = []
|
||||
dns = [ "enrtree://AKUEZKN7PSKVNR65FZDHECMKOJQSGPARGTPPBI7WS2VUL4EGR6XPC@amoy.polygon-peers.io" ]
|
||||
|
||||
# [heimdall]
|
||||
# url = "http://localhost:1317"
|
||||
|
|
@ -169,6 +169,11 @@ syncmode = "full"
|
|||
# period = 0
|
||||
# gaslimit = 11500000
|
||||
|
||||
# [parallelevm]
|
||||
# enable = true
|
||||
# procs = 8
|
||||
# enforce = false
|
||||
|
||||
# [pprof]
|
||||
# pprof = false
|
||||
# port = 6060
|
||||
|
|
|
|||
|
|
@ -36,14 +36,14 @@ syncmode = "full"
|
|||
# nodekey = ""
|
||||
# nodekeyhex = ""
|
||||
# txarrivalwait = "500ms"
|
||||
# [p2p.discovery]
|
||||
[p2p.discovery]
|
||||
# v5disc = false
|
||||
# bootnodesv5 = []
|
||||
# bootnodesv4 = []
|
||||
bootnodes = [ "enode://bce861be777e91b0a5a49d58a51e14f32f201b4c6c2d1fbea6c7a1f14756cbb3f931f3188d6b65de8b07b53ff28d03b6e366d09e56360d2124a9fc5a15a0913d@54.217.171.196:30303", "enode://4a3dc0081a346d26a73d79dd88216a9402d2292318e2db9947dbc97ea9c4afb2498dc519c0af04420dc13a238c279062da0320181e7c1461216ce4513bfd40bf@13.251.184.185:30303" ]
|
||||
static-nodes = [ "enode://383ec39eb7f7e23538ea846f502602632110a6bcfc7521bfc2b8833f5a190779507d006b28650d83674b75d188cb36bcb3c3e168a0f2b3d98f9a651cc6603146@52.214.229.208:30303", "enode://bce861be777e91b0a5a49d58a51e14f32f201b4c6c2d1fbea6c7a1f14756cbb3f931f3188d6b65de8b07b53ff28d03b6e366d09e56360d2124a9fc5a15a0913d@54.217.171.196:30303", "enode://a4a387ad423a2fd0d652808b270082250d3c616b7e8537209584ebad4806dd50ef8dc66a371c85c7f55e6c1f53747edbb11055c8073cfacf312047eaeb328f58@54.171.220.164:30303", "enode://4a3dc0081a346d26a73d79dd88216a9402d2292318e2db9947dbc97ea9c4afb2498dc519c0af04420dc13a238c279062da0320181e7c1461216ce4513bfd40bf@13.251.184.185:30303", "enode://e8fe33b52f90d4bc7a4e75800945df449d1a091bd347c9f11cd1dbcd98ea28cb4c231cb3b1c6feacdabca2aa91f1a6744724b44edc9382c107968792abdef261@52.74.18.182:30303", "enode://b240f1f18e8f3cc61df96a164ba215ea6fc3f00717e4300da6283362a0438bda53f81ecc24c575ff130066d42096319fa027c952681bbb4f003e0bdd5d5b4e61@52.76.37.145:30303", "enode://de55d16b6e1fca28cdd3d11eb0dd89e3b77b96d4722172bd5e04ac255922324076a87748e97bc021af2307dccbb5ef8062389cfcba1845f77219eee7935dea9f@52.74.125.36:30303", "enode://7f2272685fc3e31c8e43c7687dda43ea3192fd310ba01efcb7811d5dc7ad5a64402ea8cd827650e573a174cf29bb69331dffcca6f0b9894ef17eeafabd97a41d@47.128.184.10:30303", "enode://c66e12243b425b63528dd8b1ce87f2f7fbc85f35485e2d8bf6bbf0ec0dcd05b3a582ef62daadbde061b58058735788335d09ed972a451242b9943b85d323c239@63.32.214.97:30303", "enode://bd56c0f00dd37e14ae2b84f5eb50e357d3a2d326bdbb0cbb987411268b3f132288f6c86157fc132c6902d18b9be0de8bbdcd12d926e16232ebadd8e274aae780@52.208.81.179:30303", "enode://2f015d5b1571165975382281a2117a9b514e1b38e87a8116596fc9b3b121a93cfb238eb6f7b3ae30cf9c0154384372745ce9edc09cbc30526ab7e2059f57ddee@54.74.160.230:30303" ]
|
||||
bootnodes = [ "enode://0ef8758cafc0063405f3f31fe22f2a3b566aa871bd7cd405e35954ec8aa7237c21e1ccc1f65f1b6099ab36db029362bc2fecf001a771b3d9803bbf1968508cef@35.197.249.21:30303", "enode://c9c8c18cde48b41d46ced0c564496aef721a9b58f8724025a0b1f3f26f1b826f31786f890f8f8781e18b16dbb3c7bff805c7304d1273ac11630ed25a3f0dc41c@34.89.39.114:30303" ]
|
||||
static-nodes = [ "enode://0ef8758cafc0063405f3f31fe22f2a3b566aa871bd7cd405e35954ec8aa7237c21e1ccc1f65f1b6099ab36db029362bc2fecf001a771b3d9803bbf1968508cef@35.197.249.21:30303", "enode://c9c8c18cde48b41d46ced0c564496aef721a9b58f8724025a0b1f3f26f1b826f31786f890f8f8781e18b16dbb3c7bff805c7304d1273ac11630ed25a3f0dc41c@34.89.39.114:30303", "enode://5b8d436677fb545b1c3fd1ae84553d478d9d21ad3b06a908b9d34d2df367ead5bb8823d84a370e26bdde8896ba8a870e21ba3a6dce19c0ded086296df5f04f15@35.242.167.175:30303", "enode://5bd810da4f021a974e80cf2be48975d58cafbcfdd971d568ab98250f8568a9457bdc1b7a6d16b5aebfcb9deb0c1ec612f0664d5366c74f5266906a2774dd70f0@34.89.15.223:30303", "enode://a2ec3671e553ba3e711639033912be55fe1e7fa4b61a93f6a1ac0cd3cea34f9d7eec1d718e04049531cf5dd7efc1ac677df1cf0e1f24f5e677706d7bcb3917de@34.105.128.110:30303", "enode://9e15bc58779c32119140d54a8384940b57a10a001506ce173cc4cdb10876b14a2ac9ae91f9389caf9fd385c3b72825f8bbbe937e7e57b1f032561703e900da59@34.89.21.99:30303", "enode://42203e9b423aba24e1e9386f94d0d0397a42770427e8e9e22f9e2a9523f66abb13b1f5a6addee68ad5986f94a8f6de626f5829492599a2f9484f98e86e26149d@34.89.101.16:30303", "enode://83c235bb4305ecdd5addcbfd09478d2df7cddca9b7eed3ef11b2426fad04ccfe7335279e2371a85696e461dcbe78de6912d07043a912dbd85cb0bb944d78b8d9@34.89.11.233:30303" ]
|
||||
# trusted-nodes = []
|
||||
# dns = []
|
||||
dns = [ "enrtree://AKUEZKN7PSKVNR65FZDHECMKOJQSGPARGTPPBI7WS2VUL4EGR6XPC@amoy.polygon-peers.io" ]
|
||||
|
||||
# [heimdall]
|
||||
# url = "http://localhost:1317"
|
||||
|
|
@ -170,6 +170,11 @@ syncmode = "full"
|
|||
# period = 0
|
||||
# gaslimit = 11500000
|
||||
|
||||
# [parallelevm]
|
||||
# enable = true
|
||||
# procs = 8
|
||||
# enforce = false
|
||||
|
||||
# [pprof]
|
||||
# pprof = false
|
||||
# port = 6060
|
||||
|
|
|
|||
|
|
@ -78,15 +78,15 @@ var MumbaiBootnodes = []string{
|
|||
// AmoyBootnodes are the enode URLs of the P2P bootstrap nodes running on the
|
||||
// Amoy test network.
|
||||
var AmoyBootnodes = []string{
|
||||
"enode://bce861be777e91b0a5a49d58a51e14f32f201b4c6c2d1fbea6c7a1f14756cbb3f931f3188d6b65de8b07b53ff28d03b6e366d09e56360d2124a9fc5a15a0913d@54.217.171.196:30303",
|
||||
"enode://4a3dc0081a346d26a73d79dd88216a9402d2292318e2db9947dbc97ea9c4afb2498dc519c0af04420dc13a238c279062da0320181e7c1461216ce4513bfd40bf@13.251.184.185:30303",
|
||||
"enode://c9c8c18cde48b41d46ced0c564496aef721a9b58f8724025a0b1f3f26f1b826f31786f890f8f8781e18b16dbb3c7bff805c7304d1273ac11630ed25a3f0dc41c@34.89.39.114:30303",
|
||||
"enode://0ef8758cafc0063405f3f31fe22f2a3b566aa871bd7cd405e35954ec8aa7237c21e1ccc1f65f1b6099ab36db029362bc2fecf001a771b3d9803bbf1968508cef@35.197.249.21:30303",
|
||||
}
|
||||
|
||||
// BorMainnetBootnodes are the enode URLs of the P2P bootstrap nodes running on the
|
||||
// main Bor network.
|
||||
var BorMainnetBootnodes = []string{
|
||||
"enode://b8f1cc9c5d4403703fbf377116469667d2b1823c0daf16b7250aa576bacf399e42c3930ccfcb02c5df6879565a2b8931335565f0e8d3f8e72385ecf4a4bf160a@3.36.224.80:30303",
|
||||
"enode://8729e0c825f3d9cad382555f3e46dcff21af323e89025a0e6312df541f4a9e73abfa562d64906f5e59c51fe6f0501b3e61b07979606c56329c020ed739910759@54.194.245.5:30303",
|
||||
"enode://e4fb013061eba9a2c6fb0a41bbd4149f4808f0fb7e88ec55d7163f19a6f02d64d0ce5ecc81528b769ba552a7068057432d44ab5e9e42842aff5b4709aa2c3f3b@34.89.75.187:30303",
|
||||
"enode://a49da6300403cf9b31e30502eb22c142ba4f77c9dda44990bccce9f2121c3152487ee95ee55c6b92d4cdce77845e40f59fd927da70ea91cf935b23e262236d75@34.142.43.249:30303",
|
||||
}
|
||||
|
||||
var KilnBootnodes = []string{
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
VersionMajor = 1 // Major version component of the current release
|
||||
VersionMinor = 5 // Minor version component of the current release
|
||||
VersionPatch = 5 // Patch version component of the current release
|
||||
VersionMajor = 2 // Major version component of the current release
|
||||
VersionMinor = 0 // Minor version component of the current release
|
||||
VersionPatch = 0 // Patch version component of the current release
|
||||
VersionMeta = "" // Version metadata to append to the version string
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
package bor
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/ecdsa"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
|
|
@ -219,8 +218,6 @@ func buildNextBlock(t *testing.T, _bor consensus.Engine, chain *core.BlockChain,
|
|||
b.addTxWithChain(chain, state, tx, addr)
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
// Finalize and seal the block
|
||||
block, err := _bor.FinalizeAndAssemble(chain, b.header, state, &types.Body{
|
||||
Transactions: b.txs,
|
||||
|
|
@ -242,7 +239,7 @@ func buildNextBlock(t *testing.T, _bor consensus.Engine, chain *core.BlockChain,
|
|||
|
||||
res := make(chan *types.Block, 1)
|
||||
|
||||
err = _bor.Seal(ctx, chain, block, res, nil)
|
||||
err = _bor.Seal(chain, block, res, nil)
|
||||
if err != nil {
|
||||
// an error case - sign manually
|
||||
sign(t, header, signer, borConfig)
|
||||
|
|
|
|||
Loading…
Reference in a new issue