Merge branch 'develop' into anvil-ci

This commit is contained in:
Arya Lanjewar 2025-03-05 15:50:05 +05:30 committed by GitHub
commit 86fc556609
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 225 additions and 184 deletions

View file

@ -20,7 +20,7 @@ Heimdall client version: [e.g. v0.2.10] <!--Can be found by running the command
OS & Version: Windows / Linux / OSX
Environment: Polygon Mainnet / Polygon Mumbai / Polygon Amoy / Devnet
Environment: Polygon Mainnet / Polygon Amoy / Devnet
Type of node: Validator / Sentry / Archive

View file

@ -1,19 +1,29 @@
defaultStake: 10000
devnetType: docker
defaultFee: 2000
defaultStake: 10000
borChainId: 15001
heimdallChainId: heimdall-15001
contractsRepo: https://github.com/0xPolygon/pos-contracts.git
contractsBranch: anvil-pos
genesisContractsBranch: master
sprintSize:
- '64'
blockNumber:
- '0'
blockTime:
- '2'
blockNumber:
- '0'
sprintSize:
- '64'
sprintSizeBlockNumber:
- '0'
numOfBorValidators: 3
numOfBorSentries: 0
numOfBorArchiveNodes: 0
devnetBorFlags: config,config,config
numOfErigonValidators: 0
numOfErigonSentries: 0
numOfErigonArchiveNodes: 0

View file

@ -1,7 +1,7 @@
# Number of days of inactivity before an Issue is closed for lack of response
daysUntilClose: 30
# Label requiring a response
responseRequiredLabel: "need:more-information"
responseRequiredLabel: 'need:more-information'
# Comment to post when closing an Issue for lack of response. Set to `false` to disable
closeComment: >
This issue has been automatically closed because there has been no response

View file

@ -39,7 +39,7 @@ In case this PR includes changes that must be applied only to a subset of nodes,
- [ ] I have added tests to CI
- [ ] I have tested this code manually on local environment
- [ ] I have tested this code manually on remote devnet using express-cli
- [ ] I have tested this code manually on mumbai/amoy
- [ ] I have tested this code manually on amoy
- [ ] I have created new e2e tests into express-cli
### Manual tests

2
.github/stale.yml vendored
View file

@ -7,7 +7,7 @@ exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: "status:inactive"
staleLabel: 'status:inactive'
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had

View file

@ -29,7 +29,6 @@ jobs:
NUMERIC_VERSION=$( echo ${{ env.GIT_TAG }} | sed 's/[^0-9.]//g' )
echo "VERSION=$NUMERIC_VERSION" >> $GITHUB_ENV
- name: Making directory structure for yaml
run: mkdir -p packaging/deb/bor/var/lib/bor
- name: making directory structure for the systemd
@ -391,14 +390,3 @@ jobs:
packaging/deb/bor-pbss-amoy-**.deb
packaging/deb/bor-amoy-**.deb.checksum
packaging/deb/bor-pbss-amoy-**.deb.checksum

View file

@ -2,12 +2,12 @@ name: CI
on:
push:
branches:
- "master"
- "qa"
- "develop"
- 'master'
- 'qa'
- 'develop'
pull_request:
branches:
- "**"
- '**'
types: [opened, synchronize]
concurrency:
@ -16,11 +16,14 @@ concurrency:
jobs:
build:
name: Build
if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
strategy:
matrix:
os: [ ubuntu-22.04 ] # list of os: https://github.com/actions/virtual-environments
os: [ubuntu-22.04] # List of OS: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: |
@ -51,7 +54,7 @@ jobs:
if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
strategy:
matrix:
os: [ ubuntu-22.04 ] # list of os: https://github.com/actions/virtual-environments
os: [ubuntu-22.04] # List of OS: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
@ -79,7 +82,7 @@ jobs:
if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
strategy:
matrix:
os: [ ubuntu-22.04 ] # list of os: https://github.com/actions/virtual-environments
os: [ubuntu-22.04] # List of OS: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
@ -112,7 +115,7 @@ jobs:
name: unitTest-coverage
path: cover.out
#- name: Data race tests
# - name: Data race tests
# run: make test-race
# # TODO: make it work
@ -130,7 +133,7 @@ jobs:
if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
strategy:
matrix:
os: [ ubuntu-22.04 ] # list of os: https://github.com/actions/virtual-environments
os: [ubuntu-22.04] # List of OS: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
@ -167,7 +170,7 @@ jobs:
if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
strategy:
matrix:
os: [ ubuntu-22.04 ] # list of os: https://github.com/actions/virtual-environments
os: [ubuntu-22.04] # List of OS: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }}
needs: [unit-tests, integration-tests]
steps:
@ -182,7 +185,7 @@ jobs:
if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
strategy:
matrix:
os: [ ubuntu-22.04 ] # list of os: https://github.com/actions/virtual-environments
os: [ubuntu-22.04] # List of OS: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
@ -268,6 +271,37 @@ jobs:
path: |
matic-cli/devnet/logs
- name: Package code and chain data
if: always()
run: |
cd matic-cli/devnet
docker compose down --remove-orphans
cd -
timeout 2m bash bor/integration-tests/bor_health.sh
- name: Run smoke tests
run: |
echo "Funding ganache accounts..."
timeout 10m bash bor/integration-tests/fund_ganache_accounts.sh
echo "Deposit 100 matic for each account to bor network"
cd matic-cli/devnet/code/contracts
npm run truffle exec scripts/deposit.js -- --network development $(jq -r .root.tokens.MaticToken contractAddresses.json) 100000000000000000000
cd -
timeout 60m bash bor/integration-tests/smoke_test.sh
- name: Run RPC Tests
run: |
echo "Starting RPC Tests..."
timeout 5m bash bor/integration-tests/rpc_test.sh
- name: Upload logs
if: always()
uses: actions/upload-artifact@v4.4.0
with:
name: logs_${{ github.run_id }}
path: |
matic-cli/devnet/logs
- name: Package code and chain data
if: always()
run: |

View file

@ -1,10 +1,10 @@
name: "CodeQL"
name: 'CodeQL'
on:
push:
branches: [ "master", "develop" ]
branches: ['master', 'develop']
pull_request:
branches: [ "master", "develop" ]
branches: ['master', 'develop']
schedule:
- cron: '0 0 * * *'
@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'go' ]
language: ['go']
steps:
- name: Checkout repository
@ -43,4 +43,4 @@ jobs:
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
category: '/language:${{matrix.language}}'

View file

@ -1,5 +1,5 @@
name: Govuln
on: [ push, pull_request ]
on: [push, pull_request]
jobs:
govulncheck:
@ -8,7 +8,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: "1.23.6"
go-version: '1.23.6'
check-latest: true
- uses: actions/checkout@v4
- uses: technote-space/get-diff-action@v6
@ -20,4 +20,4 @@ jobs:
Makefile
- name: govulncheck
run: make vulncheck
if: "env.GIT_DIFF != ''"
if: env.GIT_DIFF != ''

View file

@ -29,7 +29,6 @@ jobs:
NUMERIC_VERSION=$( echo ${{ env.GIT_TAG }} | sed 's/[^0-9.]//g' )
echo "VERSION=$NUMERIC_VERSION" >> $GITHUB_ENV
- name: Making directory structure for yaml
run: mkdir -p packaging/deb/bor/var/lib/bor
- name: making directory structure for the systemd
@ -387,8 +386,6 @@ jobs:
NODE: archive
NETWORK: mainnet
############ Check and Upload ##########################
- name: Confirming package built
run: ls -ltr packaging/deb/ | grep bor

View file

@ -97,7 +97,6 @@ jobs:
echo "Maintainer: devops@polygon.technology" >> packaging/deb/bor/DEBIAN/control
echo "Description: bor binary package" >> packaging/deb/bor/DEBIAN/control
- name: Creating package for binary for bor ${{ env.ARCH }}
run: cp -rp packaging/deb/bor packaging/deb/bor-${{ env.GIT_TAG }}-${{ env.ARCH }}
env:

View file

@ -11,7 +11,6 @@ on:
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write

View file

@ -90,7 +90,6 @@ lintci-deps:
vulncheck:
@go run golang.org/x/vuln/cmd/govulncheck@latest ./...
goimports:
goimports -local "$(PACKAGE)" -w .

View file

@ -1,9 +1,7 @@
# Bor Overview
Bor is the Official Golang implementation of the Polygon PoS blockchain. It is a fork of [geth](https://github.com/ethereum/go-ethereum) and is EVM compatible (upto London fork).
Bor is the official Golang implementation of the Polygon PoS blockchain. It is a fork of [geth](https://github.com/ethereum/go-ethereum) and is EVM compatible (upto London fork).
[![API Reference](
https://pkg.go.dev/badge/github.com/maticnetwork/bor
)](https://pkg.go.dev/github.com/maticnetwork/bor)
[![API Reference](https://pkg.go.dev/badge/github.com/maticnetwork/bor)](https://pkg.go.dev/github.com/maticnetwork/bor)
[![Go Report Card](https://goreportcard.com/badge/github.com/maticnetwork/bor)](https://goreportcard.com/report/github.com/maticnetwork/bor)
![MIT License](https://img.shields.io/github/license/maticnetwork/bor)
[![Discord](https://img.shields.io/badge/discord-join%20chat-blue.svg)](https://discord.com/invite/0xpolygonrnd)
@ -13,15 +11,15 @@ https://pkg.go.dev/badge/github.com/maticnetwork/bor
The easiest way to get started with bor is to install the packages using the command below. Please take a look at the [releases](https://github.com/maticnetwork/bor/releases) section to find the latest stable version of bor.
curl -L https://raw.githubusercontent.com/maticnetwork/install/main/bor.sh | bash -s -- v0.4.0 <network> <node_type>
curl -L https://raw.githubusercontent.com/maticnetwork/install/main/bor.sh | bash -s -- v2.0.0 <network> <node_type>
The network accepts `mainnet`,`amoy` or `mumbai` and the node type accepts `validator` or `sentry` or `archive`. The installation script does the following things:
The network accepts `mainnet`, or `amoy` and the node type accepts `validator` or `sentry` or `archive`. The installation script does the following things:
- Create a new user named `bor`.
- Install the bor binary at `/usr/bin/bor`.
- Dump the suitable config file (based on the network and node type provided) at `/var/lib/bor` and use it as the home dir.
- Create a systemd service named `bor` at `/lib/systemd/system/bor.service` which starts bor using the config file as `bor` user.
The releases supports both the networks i.e. Polygon Mainnet, Amoy and Mumbai (Testnet) unless explicitly specified. Before the stable release for mainnet, pre-releases will be available marked with `beta` tag for deploying on Mumbai/Amoy (testnet). On sufficient testing, stable release for mainnet will be announced with a forum post.
The releases supports both the networks i.e. Polygon Mainnet, and Amoy (Testnet) unless explicitly specified. Before the stable release for mainnet, pre-releases will be available marked with `beta` tag for deploying on Amoy (testnet). On sufficient testing, stable release for mainnet will be announced with a forum post.
### Building from source

View file

@ -4,8 +4,10 @@ import (
"os"
"github.com/ethereum/go-ethereum/internal/cli"
"github.com/ethereum/go-ethereum/params"
)
func main() {
params.UpdateBorInfo()
os.Exit(cli.Run(os.Args[1:]))
}

View file

@ -22,7 +22,7 @@ The ```bor server``` command runs the Bor client.
- ```bor.withoutheimdall```: Run without Heimdall service (for testing purpose) (default: false)
- ```chain```: Name of the chain to sync ('amoy', 'mumbai', 'mainnet') or path to a genesis file (default: mainnet)
- ```chain```: Name of the chain to sync ('amoy', 'mainnet') or path to a genesis file (default: mainnet)
- ```config```: Path to the TOML configuration file

View file

@ -18,6 +18,8 @@ package params
import (
"fmt"
"github.com/ethereum/go-ethereum/metrics"
)
const (
@ -27,7 +29,20 @@ const (
VersionMeta = "" // Version metadata to append to the version string
)
var GitCommit string
var (
// borInfoGauge stores Bor git commit and version details.
borInfoGauge = metrics.NewRegisteredGaugeInfo("bor/info", nil)
GitCommit string
)
// UpdateBorInfo updates the bor_info metric with the current git commit and version details.
func UpdateBorInfo() {
borInfoGauge.Update(metrics.GaugeInfoValue{
"commit": GitCommit,
"version": VersionWithMeta,
})
}
// Version holds the textual version string.
var Version = func() string {