From 186deec830bd30db054fe0272687b39350c3f40b Mon Sep 17 00:00:00 2001 From: Marcello Ardizzone Date: Tue, 18 Feb 2025 21:03:12 +0100 Subject: [PATCH 01/25] use matic-cli docker scripts (#1454) * use matic-cli docker scripts * revert scripts for cp issue * change dir for int tests --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0988d9f156..6e969f5261 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -236,8 +236,8 @@ jobs: - name: Launch devnet run: | cd matic-cli/devnet - bash ../docker_devnet.sh - cd - + bash ../util-scripts/docker/devnet_setup.sh + cd - timeout 2m bash bor/integration-tests/bor_health.sh - name: Run smoke tests From a8bf400a30ac8ac01e696efc657c556f60a1fa7b Mon Sep 17 00:00:00 2001 From: Inplus <582872799@qq.com> Date: Thu, 27 Feb 2025 13:33:20 +0800 Subject: [PATCH 02/25] update gfp12 in crypto --- crypto/bn256/cloudflare/gfp12.go | 4 ++-- crypto/bn256/google/gfp12.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crypto/bn256/cloudflare/gfp12.go b/crypto/bn256/cloudflare/gfp12.go index 295a1d6c4b..f0fd5d210c 100644 --- a/crypto/bn256/cloudflare/gfp12.go +++ b/crypto/bn256/cloudflare/gfp12.go @@ -116,8 +116,8 @@ func (e *gfP12) Mul(a, b *gfP12) *gfP12 { } func (e *gfP12) MulScalar(a *gfP12, b *gfP6) *gfP12 { - e.x.Mul(&e.x, b) - e.y.Mul(&e.y, b) + e.x.Mul(&a.x, b) + e.y.Mul(&a.y, b) return e } diff --git a/crypto/bn256/google/gfp12.go b/crypto/bn256/google/gfp12.go index 888ed5f920..5b94810cef 100644 --- a/crypto/bn256/google/gfp12.go +++ b/crypto/bn256/google/gfp12.go @@ -135,8 +135,8 @@ func (e *gfP12) Mul(a, b *gfP12, pool *bnPool) *gfP12 { } func (e *gfP12) MulScalar(a *gfP12, b *gfP6, pool *bnPool) *gfP12 { - e.x.Mul(e.x, b, pool) - e.y.Mul(e.y, b, pool) + e.x.Mul(a.x, b, pool) + e.y.Mul(a.y, b, pool) return e } From 08b5347182fffb6964c828a4af5880714e0da8ee Mon Sep 17 00:00:00 2001 From: gitglorythegreat Date: Thu, 2 Jan 2025 21:04:06 +0800 Subject: [PATCH 03/25] cherry-pick geth 0feb999d3fd190cc67c59fc91b7094e54ff8e1a2 --- crypto/bn256/cloudflare/gfp12.go | 1 - crypto/bn256/google/gfp12.go | 1 - 2 files changed, 2 deletions(-) diff --git a/crypto/bn256/cloudflare/gfp12.go b/crypto/bn256/cloudflare/gfp12.go index f0fd5d210c..b236daefbd 100644 --- a/crypto/bn256/cloudflare/gfp12.go +++ b/crypto/bn256/cloudflare/gfp12.go @@ -118,7 +118,6 @@ func (e *gfP12) Mul(a, b *gfP12) *gfP12 { func (e *gfP12) MulScalar(a *gfP12, b *gfP6) *gfP12 { e.x.Mul(&a.x, b) e.y.Mul(&a.y, b) - return e } diff --git a/crypto/bn256/google/gfp12.go b/crypto/bn256/google/gfp12.go index 5b94810cef..7b81e09b58 100644 --- a/crypto/bn256/google/gfp12.go +++ b/crypto/bn256/google/gfp12.go @@ -137,7 +137,6 @@ func (e *gfP12) Mul(a, b *gfP12, pool *bnPool) *gfP12 { func (e *gfP12) MulScalar(a *gfP12, b *gfP6, pool *bnPool) *gfP12 { e.x.Mul(a.x, b, pool) e.y.Mul(a.y, b, pool) - return e } From 055679fbefddd5e6ecd77d7ee880d07b693bf641 Mon Sep 17 00:00:00 2001 From: gitglorythegreat Date: Thu, 2 Jan 2025 21:04:06 +0800 Subject: [PATCH 04/25] crypto/bn256: fix MulScalar (#30974) The `a` parameter should be used in the `MulScalar` function. The upstream cloudflare and google repos have already merged fixes. Reference: * https://cs.opensource.google/go/x/crypto/+/8d7daa0c54b357f3071e11eaef7efc4e19a417e2 * https://github.com/cloudflare/bn256/pull/33 --- crypto/bn256/cloudflare/gfp12.go | 5 ++--- crypto/bn256/google/gfp12.go | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/crypto/bn256/cloudflare/gfp12.go b/crypto/bn256/cloudflare/gfp12.go index 295a1d6c4b..b236daefbd 100644 --- a/crypto/bn256/cloudflare/gfp12.go +++ b/crypto/bn256/cloudflare/gfp12.go @@ -116,9 +116,8 @@ func (e *gfP12) Mul(a, b *gfP12) *gfP12 { } func (e *gfP12) MulScalar(a *gfP12, b *gfP6) *gfP12 { - e.x.Mul(&e.x, b) - e.y.Mul(&e.y, b) - + e.x.Mul(&a.x, b) + e.y.Mul(&a.y, b) return e } diff --git a/crypto/bn256/google/gfp12.go b/crypto/bn256/google/gfp12.go index 888ed5f920..7b81e09b58 100644 --- a/crypto/bn256/google/gfp12.go +++ b/crypto/bn256/google/gfp12.go @@ -135,9 +135,8 @@ func (e *gfP12) Mul(a, b *gfP12, pool *bnPool) *gfP12 { } func (e *gfP12) MulScalar(a *gfP12, b *gfP6, pool *bnPool) *gfP12 { - e.x.Mul(e.x, b, pool) - e.y.Mul(e.y, b, pool) - + e.x.Mul(a.x, b, pool) + e.y.Mul(a.y, b, pool) return e } From 375260e859a6439646bcc39333d093963b2a4e80 Mon Sep 17 00:00:00 2001 From: Lucca Martins Date: Thu, 27 Feb 2025 07:49:21 -0300 Subject: [PATCH 05/25] mutex protection on trieReader storages --- core/state/reader.go | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/core/state/reader.go b/core/state/reader.go index 6bddefc2a7..cd960a60a8 100644 --- a/core/state/reader.go +++ b/core/state/reader.go @@ -19,6 +19,7 @@ package state import ( "errors" "maps" + "sync" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/state/snapshot" @@ -139,12 +140,14 @@ func (r *stateReader) Copy() Reader { // trieReader implements the Reader interface, providing functions to access // state from the referenced trie. type trieReader struct { - root common.Hash // State root which uniquely represent a state - db *triedb.Database // Database for loading trie - buff crypto.KeccakState // Buffer for keccak256 hashing - mainTrie Trie // Main trie, resolved in constructor - subRoots map[common.Address]common.Hash // Set of storage roots, cached when the account is resolved - subTries map[common.Address]Trie // Group of storage tries, cached when it's resolved + root common.Hash // State root which uniquely represent a state + db *triedb.Database // Database for loading trie + buff crypto.KeccakState // Buffer for keccak256 hashing + mainTrie Trie // Main trie, resolved in constructor + subRoots map[common.Address]common.Hash // Set of storage roots, cached when the account is resolved + subTries map[common.Address]Trie // Group of storage tries, cached when it's resolved + muSubRoot sync.Mutex + muSubTries sync.Mutex } // trieReader constructs a trie reader of the specific state. An error will be @@ -181,11 +184,14 @@ func (r *trieReader) Account(addr common.Address) (*types.StateAccount, error) { if err != nil { return nil, err } + r.muSubRoot.Lock() if account == nil { r.subRoots[addr] = types.EmptyRootHash } else { r.subRoots[addr] = account.Root } + r.muSubRoot.Unlock() + return account, nil } @@ -221,7 +227,9 @@ func (r *trieReader) Storage(addr common.Address, key common.Hash) (common.Hash, if err != nil { return common.Hash{}, err } + r.muSubTries.Lock() r.subTries[addr] = tr + r.muSubTries.Unlock() } } ret, err := tr.GetStorage(addr, key.Bytes()) From c3259dc7d58f3d1e52cf2d717f21b39990d5d610 Mon Sep 17 00:00:00 2001 From: kamuikatsurgi Date: Fri, 28 Feb 2025 11:57:19 +0530 Subject: [PATCH 06/25] chore: CI improvements --- .github/matic-cli-config.yml | 34 +- .github/no-response.yml | 2 +- .github/stale.yml | 2 +- .github/workflows/amoy_deb_profiles.yml | 12 - .github/workflows/ci.yml | 410 +++++++++++---------- .github/workflows/codeql.yml | 10 +- .github/workflows/govulncheck.yml | 6 +- .github/workflows/mainnet_deb_profiles.yml | 5 +- .github/workflows/packager_deb.yml | 3 +- .github/workflows/release.yml | 6 +- .github/workflows/stale.yml | 27 +- Makefile | 1 - 12 files changed, 261 insertions(+), 257 deletions(-) diff --git a/.github/matic-cli-config.yml b/.github/matic-cli-config.yml index e3200ec8b8..24f2b29ca6 100644 --- a/.github/matic-cli-config.yml +++ b/.github/matic-cli-config.yml @@ -1,26 +1,36 @@ -defaultStake: 10000 +devnetType: docker + defaultFee: 2000 +defaultStake: 10000 + borChainId: 15001 heimdallChainId: heimdall-15001 -contractsBranch: mardizzone/node-16 + +borDockerBuildContext: '../../bor' +heimdallDockerBuildContext: 'https://github.com/maticnetwork/heimdall.git#develop' + genesisContractsBranch: master -sprintSize: - - '64' -blockNumber: - - '0' +contractsBranch: mardizzone/node-16 + blockTime: - '2' +blockNumber: + - '0' + +sprintSize: + - '64' +sprintSizeBlockNumber: + - '0' + numOfBorValidators: 3 numOfBorSentries: 0 numOfBorArchiveNodes: 0 + +devnetBorFlags: config,config,config + numOfErigonValidators: 0 numOfErigonSentries: 0 numOfErigonArchiveNodes: 0 + ethURL: http://ganache:9545 ethHostUser: ubuntu -devnetType: docker -borDockerBuildContext: "../../bor" -heimdallDockerBuildContext: "https://github.com/maticnetwork/heimdall.git#develop" -sprintSizeBlockNumber: - - '0' -devnetBorFlags: config,config,config diff --git a/.github/no-response.yml b/.github/no-response.yml index 903d4ce85f..d6a261b363 100644 --- a/.github/no-response.yml +++ b/.github/no-response.yml @@ -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 diff --git a/.github/stale.yml b/.github/stale.yml index 6d921cc795..f41dc2d876 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -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 diff --git a/.github/workflows/amoy_deb_profiles.yml b/.github/workflows/amoy_deb_profiles.yml index 6f4d16fb7e..80b73335cf 100644 --- a/.github/workflows/amoy_deb_profiles.yml +++ b/.github/workflows/amoy_deb_profiles.yml @@ -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 - - - - - - - - - - - diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c2543b5f3..f8a3b71921 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,12 +2,12 @@ name: CI on: push: branches: - - "master" - - "qa" - - "develop" + - 'master' + - 'qa' + - 'develop' pull_request: branches: - - "**" + - '**' types: [opened, synchronize] concurrency: @@ -15,268 +15,280 @@ concurrency: cancel-in-progress: true jobs: - build: + build-ubuntu: + name: Build (Ubuntu-22.04) + 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: | - git submodule update --init --recursive --force - git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master + - uses: actions/checkout@v4 + - run: | + git submodule update --init --recursive --force + git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master - - uses: actions/setup-go@v5 - with: - go-version: 1.23.x + - uses: actions/setup-go@v5 + with: + go-version: 1.23.x - - name: Install dependencies on Linux - if: runner.os == 'Linux' - run: sudo apt update && sudo apt install build-essential + - name: Install dependencies on Linux + if: runner.os == 'Linux' + run: sudo apt update && sudo apt install build-essential - - uses: actions/cache@v3 - with: - path: | - ~/.cache/go-build - ~/Library/Caches/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-go- + - uses: actions/cache@v3 + with: + path: | + ~/.cache/go-build + ~/Library/Caches/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ runner.os }}-go- - - name: Build - run: make all + - name: Build + run: make all + + build-windows: + name: Build (Windows) + + if: (github.event.action != 'closed' || github.event.pull_request.merged == true) + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + - run: | + git submodule update --init --recursive --force + git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master + + - uses: actions/setup-go@v5 + with: + go-version: 1.23.x + + - name: Install dependencies on Windows + run: | + choco install mingw + + - name: Build + run: make all lint: 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: | - git submodule update --init --recursive --force - git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master + - uses: actions/checkout@v4 + - run: | + git submodule update --init --recursive --force + git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master - - uses: actions/setup-go@v5 - with: - go-version: 1.23.x + - uses: actions/setup-go@v5 + with: + go-version: 1.23.x - - name: Install dependencies on Linux - if: runner.os == 'Linux' - run: sudo apt update && sudo apt install build-essential + - name: Install dependencies on Linux + if: runner.os == 'Linux' + run: sudo apt update && sudo apt install build-essential - - name: Golang-ci install - if: runner.os == 'Linux' - run: make lintci-deps + - name: Golang-ci install + if: runner.os == 'Linux' + run: make lintci-deps - - name: Lint - if: runner.os == 'Linux' - run: make lint + - name: Lint + if: runner.os == 'Linux' + run: make lint unit-tests: 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: | - git submodule update --init --recursive --force - git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master + - uses: actions/checkout@v4 + - run: | + git submodule update --init --recursive --force + git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master - - uses: actions/setup-go@v5 - with: - go-version: 1.23.x + - uses: actions/setup-go@v5 + with: + go-version: 1.23.x - - name: Install dependencies on Linux - if: runner.os == 'Linux' - run: sudo apt update && sudo apt install build-essential + - name: Install dependencies on Linux + if: runner.os == 'Linux' + run: sudo apt update && sudo apt install build-essential - - uses: actions/cache@v3 - with: - path: | - ~/.cache/go-build - ~/Library/Caches/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-go- + - uses: actions/cache@v3 + with: + path: | + ~/.cache/go-build + ~/Library/Caches/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ runner.os }}-go- - - name: Test - run: make test + - name: Test + run: make test - - uses: actions/upload-artifact@v4.4.0 - with: - name: unitTest-coverage - path: cover.out - - #- name: Data race tests - # run: make test-race - - # # TODO: make it work - # - name: Reproducible build test - # run: | - # make geth - # shasum -a256 ./build/bin/geth > bor1.sha256 - # make geth - # shasum -a256 ./build/bin/geth > bor2.sha256 - # if ! cmp -s bor1.sha256 bor2.sha256; then - # echo >&2 "Reproducible build broken"; cat bor1.sha256; cat bor2.sha256; exit 1 - # fi + - uses: actions/upload-artifact@v4.4.0 + with: + name: unitTest-coverage + path: cover.out integration-tests: 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: | - git submodule update --init --recursive --force - git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master + - uses: actions/checkout@v4 + - run: | + git submodule update --init --recursive --force + git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master - - uses: actions/setup-go@v5 - with: - go-version: 1.23.x + - uses: actions/setup-go@v5 + with: + go-version: 1.23.x - - name: Install dependencies on Linux - if: runner.os == 'Linux' - run: sudo apt update && sudo apt install build-essential + - name: Install dependencies on Linux + if: runner.os == 'Linux' + run: sudo apt update && sudo apt install build-essential - - uses: actions/cache@v4 - with: - path: | - ~/.cache/go-build - ~/Library/Caches/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-go- + - uses: actions/cache@v4 + with: + path: | + ~/.cache/go-build + ~/Library/Caches/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ runner.os }}-go- - - name: test-integration - run: make test-integration + - name: test-integration + run: make test-integration - - uses: actions/upload-artifact@v4.4.0 - with: - name: integrationTest-coverage - path: cover.out + - uses: actions/upload-artifact@v4.4.0 + with: + name: integrationTest-coverage + path: cover.out codecov: 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: - - name: Checkout - uses: actions/checkout@v4 - - name: Download artifacts - uses: actions/download-artifact@v4.1.8 - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + - name: Checkout + uses: actions/checkout@v4 + - name: Download artifacts + uses: actions/download-artifact@v4.1.8 + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 e2e-tests: 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 - with: - path: bor - - name: Checkout submodules - run: | - cd bor - git submodule update --init --recursive --force - git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master + - uses: actions/checkout@v4 + with: + path: bor + - name: Checkout submodules + run: | + cd bor + git submodule update --init --recursive --force + git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master - - uses: actions/setup-go@v5 - with: - go-version: 1.23.x + - uses: actions/setup-go@v5 + with: + go-version: 1.23.x - - name: Checkout matic-cli - uses: actions/checkout@v4 - with: - repository: maticnetwork/matic-cli - ref: master - path: matic-cli + - name: Checkout matic-cli + uses: actions/checkout@v4 + with: + repository: maticnetwork/matic-cli + ref: master + path: matic-cli - - name: Install dependencies on Linux - if: runner.os == 'Linux' - run: | - sudo apt update - sudo apt install build-essential - curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash - sudo snap install solc - sudo apt install python2 jq curl - sudo ln -sf /usr/bin/python2 /usr/bin/python + - name: Install dependencies on Linux + if: runner.os == 'Linux' + run: | + sudo apt update + sudo apt install build-essential + curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash + sudo snap install solc + sudo apt install python2 jq curl + sudo ln -sf /usr/bin/python2 /usr/bin/python - - uses: actions/setup-node@v3 - with: - node-version: '18.19.0' - cache: 'npm' - cache-dependency-path: | - matic-cli/package-lock.json - matic-cli/devnet/code/contracts/package-lock.json - matic-cli/devnet/code/genesis-contracts/package-lock.json - matic-cli/devnet/code/genesis-contracts/matic-contracts/package-lock.json + - uses: actions/setup-node@v3 + with: + node-version: '18.19.0' + cache: 'npm' + cache-dependency-path: | + matic-cli/package-lock.json + matic-cli/devnet/code/contracts/package-lock.json + matic-cli/devnet/code/genesis-contracts/package-lock.json + matic-cli/devnet/code/genesis-contracts/matic-contracts/package-lock.json - - name: Bootstrap devnet - run: | - cd matic-cli - npm install --prefer-offline --no-audit --progress=false - mkdir devnet - cd devnet - ../bin/matic-cli.js setup devnet -c ../../bor/.github/matic-cli-config.yml + - name: Bootstrap devnet + run: | + cd matic-cli + npm install --prefer-offline --no-audit --progress=false + mkdir devnet + cd devnet + ../bin/matic-cli.js setup devnet -c ../../bor/.github/matic-cli-config.yml - - name: Launch devnet - run: | - cd matic-cli/devnet - bash ../util-scripts/docker/devnet_setup.sh - 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 + - name: Launch devnet + run: | + cd matic-cli/devnet + bash ../util-scripts/docker/devnet_setup.sh cd - - timeout 60m bash bor/integration-tests/smoke_test.sh + timeout 2m bash bor/integration-tests/bor_health.sh - - name: Run RPC Tests - run: | - echo "Starting RPC Tests..." - timeout 5m bash bor/integration-tests/rpc_test.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: Upload logs - if: always() - uses: actions/upload-artifact@v4.4.0 - with: - name: logs_${{ github.run_id }} - path: | - matic-cli/devnet/logs + - name: Run RPC Tests + run: | + echo "Starting RPC Tests..." + timeout 5m bash bor/integration-tests/rpc_test.sh - - name: Package code and chain data - if: always() - run: | - cd matic-cli/devnet - docker compose down --remove-orphans - cd - - mkdir -p ${{ github.run_id }}/matic-cli - sudo mv bor ${{ github.run_id }} - sudo mv matic-cli/devnet ${{ github.run_id }}/matic-cli - sudo tar czf code.tar.gz ${{ github.run_id }} + - name: Upload logs + if: always() + uses: actions/upload-artifact@v4.4.0 + with: + name: logs_${{ github.run_id }} + path: | + matic-cli/devnet/logs - - name: Upload code and chain data - if: always() - uses: actions/upload-artifact@v4.4.0 - with: - name: code_${{ github.run_id }} - path: code.tar.gz + - name: Package code and chain data + if: always() + run: | + cd matic-cli/devnet + docker compose down --remove-orphans + cd - + mkdir -p ${{ github.run_id }}/matic-cli + sudo mv bor ${{ github.run_id }} + sudo mv matic-cli/devnet ${{ github.run_id }}/matic-cli + sudo tar czf code.tar.gz ${{ github.run_id }} + + - name: Upload code and chain data + if: always() + uses: actions/upload-artifact@v4.4.0 + with: + name: code_${{ github.run_id }} + path: code.tar.gz diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 37c18457f9..bfff45c8fd 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -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}}' diff --git a/.github/workflows/govulncheck.yml b/.github/workflows/govulncheck.yml index f72b29a699..99f03126f3 100644 --- a/.github/workflows/govulncheck.yml +++ b/.github/workflows/govulncheck.yml @@ -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 != '' diff --git a/.github/workflows/mainnet_deb_profiles.yml b/.github/workflows/mainnet_deb_profiles.yml index e8ee619c6f..893e5dce80 100644 --- a/.github/workflows/mainnet_deb_profiles.yml +++ b/.github/workflows/mainnet_deb_profiles.yml @@ -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 @@ -402,4 +399,4 @@ jobs: packaging/deb/bor-mainnet-**.deb packaging/deb/bor-pbss-mainnet-**.deb packaging/deb/bor-mainnet-**.deb.checksum - packaging/deb/bor-pbss-mainnet-**.deb.checksum \ No newline at end of file + packaging/deb/bor-pbss-mainnet-**.deb.checksum diff --git a/.github/workflows/packager_deb.yml b/.github/workflows/packager_deb.yml index f16013d55a..6d178e7293 100644 --- a/.github/workflows/packager_deb.yml +++ b/.github/workflows/packager_deb.yml @@ -25,7 +25,7 @@ jobs: uses: actions/setup-go@master with: go-version: 1.23.6 - # Variables + # Variables - name: Adding TAG to ENV run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV - name: adding version @@ -96,7 +96,6 @@ jobs: echo "Architecture: arm64" >> packaging/deb/bor/DEBIAN/control 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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 14c21f63d6..d6f9eb60ab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,8 +26,8 @@ jobs: - name: Prepare id: prepare run: | - TAG=${GITHUB_REF#refs/tags/} - echo ::set-output name=tag_name::${TAG} + TAG=${GITHUB_REF#refs/tags/} + echo ::set-output name=tag_name::${TAG} - name: Login to Docker Hub uses: docker/login-action@v2 @@ -40,7 +40,7 @@ jobs: - name: Run GoReleaser run: | - make release + make release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} VERSION: ${{ steps.prepare.outputs.tag_name }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index db62f6b0f5..676ddf47a6 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -7,26 +7,25 @@ name: Mark stale issues and pull requests on: schedule: - - cron: '0 0 * * *' + - cron: '0 0 * * *' jobs: stale: - runs-on: ubuntu-latest permissions: issues: write pull-requests: write steps: - - 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.' - stale-pr-message: 'This PR is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 14 days.' - close-issue-message: 'This issue was closed because it has been stalled for 28 days with no activity.' - close-pr-message: 'This PR was closed because it has been stalled for 35 days with no activity.' - days-before-issue-stale: 14 - days-before-pr-stale: 21 - days-before-issue-close: 14 - days-before-pr-close: 14 - exempt-draft-pr: true + - 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.' + stale-pr-message: 'This PR is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 14 days.' + close-issue-message: 'This issue was closed because it has been stalled for 28 days with no activity.' + close-pr-message: 'This PR was closed because it has been stalled for 35 days with no activity.' + days-before-issue-stale: 14 + days-before-pr-stale: 21 + days-before-issue-close: 14 + days-before-pr-close: 14 + exempt-draft-pr: true diff --git a/Makefile b/Makefile index 566d5be5c8..40ec2b58ac 100644 --- a/Makefile +++ b/Makefile @@ -90,7 +90,6 @@ lintci-deps: vulncheck: @go run golang.org/x/vuln/cmd/govulncheck@latest ./... - goimports: goimports -local "$(PACKAGE)" -w . From 3be55f8b7de9645e5ea9bc7290d662117c1738e0 Mon Sep 17 00:00:00 2001 From: kamuikatsurgi Date: Fri, 28 Feb 2025 12:02:29 +0530 Subject: [PATCH 07/25] revert comment deletions --- .github/workflows/ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8a3b71921..7030a21d61 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -138,6 +138,20 @@ jobs: name: unitTest-coverage path: cover.out + # - name: Data race tests + # run: make test-race + + # # TODO: make it work + # - name: Reproducible build test + # run: | + # make geth + # shasum -a256 ./build/bin/geth > bor1.sha256 + # make geth + # shasum -a256 ./build/bin/geth > bor2.sha256 + # if ! cmp -s bor1.sha256 bor2.sha256; then + # echo >&2 "Reproducible build broken"; cat bor1.sha256; cat bor2.sha256; exit 1 + # fi + integration-tests: if: (github.event.action != 'closed' || github.event.pull_request.merged == true) strategy: From f169f788d7336df8836e8172ca5513f8d39383ba Mon Sep 17 00:00:00 2001 From: kamuikatsurgi Date: Fri, 28 Feb 2025 12:47:56 +0530 Subject: [PATCH 08/25] add cache for windows build --- .github/workflows/ci.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7030a21d61..dcd5ba2136 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,7 +68,15 @@ jobs: - name: Install dependencies on Windows run: | - choco install mingw + choco install mingw -y + + - uses: actions/cache@v3 + with: + path: | + ${{ env.USERPROFILE }}\go\pkg\mod + ${{ env.LOCALAPPDATA }}\go-build + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ runner.os }}-go- - name: Build run: make all From dad791aaca511fbc91564b1801b74799bbf8767b Mon Sep 17 00:00:00 2001 From: kamuikatsurgi Date: Fri, 28 Feb 2025 14:16:34 +0530 Subject: [PATCH 09/25] chore --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcd5ba2136..222b9ecd6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,8 @@ concurrency: cancel-in-progress: true jobs: - build-ubuntu: - name: Build (Ubuntu-22.04) + build: + name: Build if: (github.event.action != 'closed' || github.event.pull_request.merged == true) strategy: @@ -70,11 +70,11 @@ jobs: run: | choco install mingw -y - - uses: actions/cache@v3 + - name: Cache Go modules + uses: actions/cache@v3 with: path: | - ${{ env.USERPROFILE }}\go\pkg\mod - ${{ env.LOCALAPPDATA }}\go-build + ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-go- From a1b401460bfaa0b4709123b04f77dd5c6a6e7176 Mon Sep 17 00:00:00 2001 From: Arya Lanjewar <102943033+AryaLanjewar3005@users.noreply.github.com> Date: Fri, 28 Feb 2025 15:06:13 +0530 Subject: [PATCH 10/25] CI changes to accommodate Anvil --- .github/matic-cli-config.yml | 4 ++-- .github/workflows/ci.yml | 15 ++++++++++----- integration-tests/fund_ganache_accounts.sh | 19 ------------------- 3 files changed, 12 insertions(+), 26 deletions(-) delete mode 100644 integration-tests/fund_ganache_accounts.sh diff --git a/.github/matic-cli-config.yml b/.github/matic-cli-config.yml index e3200ec8b8..bccace99dd 100644 --- a/.github/matic-cli-config.yml +++ b/.github/matic-cli-config.yml @@ -2,7 +2,7 @@ defaultStake: 10000 defaultFee: 2000 borChainId: 15001 heimdallChainId: heimdall-15001 -contractsBranch: mardizzone/node-16 +contractsBranch: anvil-pos genesisContractsBranch: master sprintSize: - '64' @@ -16,7 +16,7 @@ numOfBorArchiveNodes: 0 numOfErigonValidators: 0 numOfErigonSentries: 0 numOfErigonArchiveNodes: 0 -ethURL: http://ganache:9545 +ethURL: http://anvil:9545 ethHostUser: ubuntu devnetType: docker borDockerBuildContext: "../../bor" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c2543b5f3..a8c6a214c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -225,6 +225,9 @@ jobs: matic-cli/devnet/code/genesis-contracts/package-lock.json matic-cli/devnet/code/genesis-contracts/matic-contracts/package-lock.json + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + - name: Bootstrap devnet run: | cd matic-cli @@ -242,12 +245,14 @@ jobs: - 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 - + cd matic-cli/devnet/devnet + SCRIPT_ADDRESS=$(jq -r '.[0].address' signer-dump.json) + SCRIPT_PRIVATE_KEY=$(jq -r '.[0].priv_key' signer-dump.json) + cd ../code/pos-contracts + CONTRACT_ADDRESS=$(jq -r .root.tokens.MaticToken contractAddresses.json) + forge script scripts/matic-cli-scripts/Deposit.s.sol:MaticDeposit --rpc-url http://localhost:9545 --private-key $SCRIPT_PRIVATE_KEY --broadcast --sig "run(address,address,uint256)" $SCRIPT_ADDRESS $CONTRACT_ADDRESS 100000000000000000000 + cd ../../../.. timeout 60m bash bor/integration-tests/smoke_test.sh - name: Run RPC Tests diff --git a/integration-tests/fund_ganache_accounts.sh b/integration-tests/fund_ganache_accounts.sh deleted file mode 100644 index 40daaedd4e..0000000000 --- a/integration-tests/fund_ganache_accounts.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -host='localhost' - -echo "Transferring 1 ETH from ganache account[0] to all others..." - -signersFile="matic-cli/devnet/devnet/signer-dump.json" -signersDump=$(jq . $signersFile) -signersLength=$(jq '. | length' $signersFile) - -rootChainWeb3="http://${host}:9545" - -for ((i = 1; i < signersLength; i++)); do - to_address=$(echo "$signersDump" | jq -r ".[$i].address") - from_address=$(echo "$signersDump" | jq -r ".[0].address") - txReceipt=$(curl $rootChainWeb3 -X POST --data '{"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{"to":"'"$to_address"'","from":"'"$from_address"'","value":"0xDE0B6B3A7640000"}],"id":1}' -H "Content-Type: application/json") - txHash=$(echo "$txReceipt" | jq -r '.result') - echo "Funds transferred from $from_address to $to_address with txHash: $txHash" -done From befc5dbde225410a74f98a83086f52c029d5cb87 Mon Sep 17 00:00:00 2001 From: Arya Lanjewar <102943033+AryaLanjewar3005@users.noreply.github.com> Date: Fri, 28 Feb 2025 15:14:20 +0530 Subject: [PATCH 11/25] Temp changed CI branch for testing anvil compatibility --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8c6a214c3..61097339ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -202,7 +202,7 @@ jobs: uses: actions/checkout@v4 with: repository: maticnetwork/matic-cli - ref: master + ref: arya/anvil/pos-1869 path: matic-cli - name: Install dependencies on Linux From 0b095994df1690a0c8d2caeb394a147c403f0b5e Mon Sep 17 00:00:00 2001 From: kamuikatsurgi Date: Fri, 28 Feb 2025 16:20:17 +0530 Subject: [PATCH 12/25] Remove windows build check --- .github/workflows/ci.yml | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 222b9ecd6f..c91c8b160b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,37 +50,6 @@ jobs: - name: Build run: make all - build-windows: - name: Build (Windows) - - if: (github.event.action != 'closed' || github.event.pull_request.merged == true) - runs-on: windows-latest - - steps: - - uses: actions/checkout@v4 - - run: | - git submodule update --init --recursive --force - git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master - - - uses: actions/setup-go@v5 - with: - go-version: 1.23.x - - - name: Install dependencies on Windows - run: | - choco install mingw -y - - - name: Cache Go modules - uses: actions/cache@v3 - with: - path: | - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-go- - - - name: Build - run: make all - lint: if: (github.event.action != 'closed' || github.event.pull_request.merged == true) strategy: From d6fa743fb6f3b9178a05caa36daabfe83bda0ee3 Mon Sep 17 00:00:00 2001 From: Arya Lanjewar <102943033+AryaLanjewar3005@users.noreply.github.com> Date: Fri, 28 Feb 2025 16:53:34 +0530 Subject: [PATCH 13/25] added mnemonics to matic-cli config --- .github/matic-cli-config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/matic-cli-config.yml b/.github/matic-cli-config.yml index bccace99dd..f096c132ca 100644 --- a/.github/matic-cli-config.yml +++ b/.github/matic-cli-config.yml @@ -24,3 +24,4 @@ heimdallDockerBuildContext: "https://github.com/maticnetwork/heimdall.git#develo sprintSizeBlockNumber: - '0' devnetBorFlags: config,config,config +mnemonic: 'clock radar mass judge dismiss just intact mind resemble fringe diary casino' From 4d609129d912638da066a37568ca45575a16100c Mon Sep 17 00:00:00 2001 From: Arya Lanjewar <102943033+AryaLanjewar3005@users.noreply.github.com> Date: Fri, 28 Feb 2025 17:14:55 +0530 Subject: [PATCH 14/25] changed matic-cli branch to master --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61097339ec..a8c6a214c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -202,7 +202,7 @@ jobs: uses: actions/checkout@v4 with: repository: maticnetwork/matic-cli - ref: arya/anvil/pos-1869 + ref: master path: matic-cli - name: Install dependencies on Linux From 2085a1f85d0cd0a1281679f2b038fe12dcda7855 Mon Sep 17 00:00:00 2001 From: Arya Lanjewar <102943033+AryaLanjewar3005@users.noreply.github.com> Date: Fri, 28 Feb 2025 21:28:50 +0530 Subject: [PATCH 15/25] added contractsRepo to matic-cli config --- .github/matic-cli-config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/matic-cli-config.yml b/.github/matic-cli-config.yml index f096c132ca..c33854f259 100644 --- a/.github/matic-cli-config.yml +++ b/.github/matic-cli-config.yml @@ -2,6 +2,7 @@ defaultStake: 10000 defaultFee: 2000 borChainId: 15001 heimdallChainId: heimdall-15001 +contractsRepo: https://github.com/0xPolygon/pos-contracts.git contractsBranch: anvil-pos genesisContractsBranch: master sprintSize: From 7afea05a0dccae779f150182088d159f7a382a01 Mon Sep 17 00:00:00 2001 From: kamuikatsurgi Date: Mon, 3 Mar 2025 15:06:02 +0530 Subject: [PATCH 16/25] feat: bor_info metric --- cmd/cli/main.go | 2 ++ params/version.go | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/cmd/cli/main.go b/cmd/cli/main.go index af4b7d8075..5863276d0b 100644 --- a/cmd/cli/main.go +++ b/cmd/cli/main.go @@ -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:])) } diff --git a/params/version.go b/params/version.go index 43c57b5365..0fa58e33fd 100644 --- a/params/version.go +++ b/params/version.go @@ -18,6 +18,8 @@ package params import ( "fmt" + + "github.com/ethereum/go-ethereum/metrics" ) const ( @@ -27,7 +29,18 @@ const ( VersionMeta = "" // Version metadata to append to the version string ) -var GitCommit string +var ( + borInfo = metrics.NewRegisteredGaugeInfo("bor/info", nil) + GitCommit string +) + +// UpdateBorInfo updates the bor_info with the current git commit and version details. +func UpdateBorInfo() { + borInfo.Update(metrics.GaugeInfoValue{ + "commit": GitCommit, + "version": VersionWithMeta, + }) +} // Version holds the textual version string. var Version = func() string { From 192f6d27043557952ab498a0b3a52789139dbaed Mon Sep 17 00:00:00 2001 From: kamuikatsurgi Date: Mon, 3 Mar 2025 17:08:58 +0530 Subject: [PATCH 17/25] chore: improve comments --- params/version.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/params/version.go b/params/version.go index 0fa58e33fd..cc4add1c6f 100644 --- a/params/version.go +++ b/params/version.go @@ -30,13 +30,15 @@ const ( ) var ( - borInfo = metrics.NewRegisteredGaugeInfo("bor/info", nil) + // borInfoGauge stores Bor git commit and version details. + borInfoGauge = metrics.NewRegisteredGaugeInfo("bor/info", nil) + GitCommit string ) -// UpdateBorInfo updates the bor_info with the current git commit and version details. +// UpdateBorInfo updates the bor_info metric with the current git commit and version details. func UpdateBorInfo() { - borInfo.Update(metrics.GaugeInfoValue{ + borInfoGauge.Update(metrics.GaugeInfoValue{ "commit": GitCommit, "version": VersionWithMeta, }) From 3d0004abae1bc85babf9e75e12e6c70187594437 Mon Sep 17 00:00:00 2001 From: kamuikatsurgi Date: Wed, 5 Mar 2025 13:58:44 +0530 Subject: [PATCH 18/25] Remove mumbai from README --- .github/ISSUE_TEMPLATE/bug.md | 2 +- .github/pull_request_template.md | 2 +- README.md | 12 +++++------- docs/cli/server.md | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index 603cb7b582..ed3ac81c86 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -20,7 +20,7 @@ Heimdall client version: [e.g. v0.2.10]