Skip to content

chore: merge main to develop post release v2.1.0 #1273

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 24, 2025
Merged
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Setup Go
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -coverprofile=coverage.txt -service=github
- uses: bissolli/gh-action-persist-workspace@v1
- uses: bissolli/gh-action-persist-workspace@v2
with:
action: persist

Expand All @@ -75,7 +75,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "20"

Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
mv razor_go.linux-amd64.tar.gz ../../

- name: Upload AMD Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: razor_go.linux-amd64.tar.gz
path: razor_go.linux-amd64.tar.gz
Expand All @@ -117,7 +117,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "20"

Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
mv razor_go.linux-arm64.tar.gz ../../

- name: Upload ARM Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: razor_go.linux-arm64.tar.gz
path: razor_go.linux-arm64.tar.gz
Expand All @@ -166,17 +166,17 @@ jobs:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Download Artifacts AMD
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: razor_go.linux-amd64.tar.gz

- name: Download Artifacts ARM
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: razor_go.linux-arm64.tar.gz

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.23
- name: Cache npm modules
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Cache Go dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -coverprofile=coverage.txt -service=github
- uses: bissolli/gh-action-persist-workspace@v1
- uses: bissolli/gh-action-persist-workspace@v2
with:
action: persist

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.23
- name: Cache npm modules
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Cache Go dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -coverprofile=coverage.txt -service=github
- uses: bissolli/gh-action-persist-workspace@v1
- uses: bissolli/gh-action-persist-workspace@v2
with:
action: persist

Expand Down
20 changes: 20 additions & 0 deletions block/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,26 @@ func (bm *BlockMonitor) updateLatestBlock() {
bm.mu.Lock()
defer bm.mu.Unlock()

// Check if the fetched block number is less than the last recorded block number.
if bm.latestBlock != nil && header.Number.Uint64() < bm.latestBlock.Number.Uint64() {
logrus.Warnf("Fetched block number %d is less than the last recorded block number %d. Switching to the next best RPC endpoint.",
header.Number.Uint64(), bm.latestBlock.Number.Uint64())

// Attempt to switch to the next best RPC endpoint.
if bm.rpcManager != nil {
switched, err := bm.rpcManager.SwitchToNextBestRPCClient()
if err != nil {
logrus.Errorf("Failed to switch RPC endpoint: %v", err)
} else if switched {
logrus.Info("Switched to the next best RPC endpoint.")
bm.updateClient()
} else {
logrus.Warn("Retaining the current best RPC endpoint as no valid alternate was found.")
}
}
return
}

// Update the latest block only if it changes.
if bm.latestBlock == nil || header.Number.Uint64() != bm.latestBlock.Number.Uint64() {
bm.latestBlock = header
Expand Down
Loading
Loading