Skip to content

Restore Taiko FCU timestamp validation allowing equal timestamps #26718

Restore Taiko FCU timestamp validation allowing equal timestamps

Restore Taiko FCU timestamp validation allowing equal timestamps #26718

name: Nethermind/Ethereum tests
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
push:
branches: [master]
workflow_dispatch:
inputs:
coverage:
default: false
description: Collect coverage
required: false
type: boolean
env:
COLLECT_COVERAGE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' || github.event.inputs.coverage }}
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: 1
TERM: xterm
defaults:
run:
shell: bash
jobs:
tests:
name: Run ${{ matrix.project }} [${{ matrix.os.label }}]
runs-on: ${{ matrix.os.runner }}
timeout-minutes: 15
continue-on-error: true
outputs:
collect_coverage: ${{ env.COLLECT_COVERAGE }}
strategy:
fail-fast: false
matrix:
os:
- { runner: ubuntu-latest, label: ubuntu-latest }
- { runner: ubuntu-24.04-arm, label: ubuntu-24.04-arm }
- { runner: windows-latest, label: windows-latest }
project:
- Nethermind.Abi.Test
- Nethermind.Api.Test
- Nethermind.AuRa.Test
- Nethermind.Blockchain.Test
- Nethermind.Clique.Test
- Nethermind.Config.Test
- Nethermind.Consensus.Test
- Nethermind.Core.Test
- Nethermind.Db.Test
- Nethermind.Era1.Test
- Nethermind.Ethash.Test
- Nethermind.EthStats.Test
- Nethermind.Evm.Test
- Nethermind.Facade.Test
- Nethermind.Flashbots.Test
- Nethermind.HealthChecks.Test
- Nethermind.History.Test
- Nethermind.Hive.Test
- Nethermind.JsonRpc.Test
- Nethermind.JsonRpc.TraceStore.Test
- Nethermind.KeyStore.Test
- Nethermind.Logging.NLog.Test
- Nethermind.Merge.AuRa.Test
- Nethermind.Merge.Plugin.Test
- Nethermind.Mining.Test
- Nethermind.Monitoring.Test
- Nethermind.Network.Discovery.Test
- Nethermind.Network.Dns.Test
- Nethermind.Network.Enr.Test
- Nethermind.Network.Test
- Nethermind.Optimism.Test
- Nethermind.Runner.Test
- Nethermind.Serialization.Ssz.Test
- Nethermind.Shutter.Test
- Nethermind.Sockets.Test
- Nethermind.Specs.Test
- Nethermind.State.Test
- Nethermind.State.Test.Runner.Test
- Nethermind.Synchronization.Test
- Nethermind.Taiko.Test
- Nethermind.Trie.Test
- Nethermind.TxPool.Test
- Nethermind.Wallet.Test
- Nethermind.Xdc.Test
include: # macOS only for OS-sensitive tests (I/O, networking, sockets)
- { os: { runner: macos-latest, label: macos-latest }, project: Nethermind.Db.Test }
- { os: { runner: macos-latest, label: macos-latest }, project: Nethermind.JsonRpc.Test }
- { os: { runner: macos-latest, label: macos-latest }, project: Nethermind.KeyStore.Test }
- { os: { runner: macos-latest, label: macos-latest }, project: Nethermind.Network.Discovery.Test }
- { os: { runner: macos-latest, label: macos-latest }, project: Nethermind.Network.Dns.Test }
- { os: { runner: macos-latest, label: macos-latest }, project: Nethermind.Network.Enr.Test }
- { os: { runner: macos-latest, label: macos-latest }, project: Nethermind.Network.Test }
- { os: { runner: macos-latest, label: macos-latest }, project: Nethermind.Runner.Test }
- { os: { runner: macos-latest, label: macos-latest }, project: Nethermind.Sockets.Test }
- { os: { runner: macos-latest, label: macos-latest }, project: Nethermind.Synchronization.Test }
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up .NET
uses: actions/setup-dotnet@v5
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('Directory.Packages.props', 'global.json') }}
restore-keys: nuget-${{ runner.os }}-
- name: ${{ matrix.project }}
id: test
working-directory: src/Nethermind/${{ matrix.project }}
run: |
flags="${{ matrix.os.label == 'ubuntu-latest' && env.COLLECT_COVERAGE == 'true' && '--coverage --coverage-output-format cobertura --coverage-settings $GITHUB_WORKSPACE/src/Nethermind/codecoverage.config' || '' }}"
set +e
dotnet test --project ${{ matrix.project }}.csproj -c release $flags
rc=$?
set -e
if [[ $rc -eq 0 ]]; then
exit 0
elif [[ $rc -eq 1 ]]; then
exit 1
else
echo "::warning::Test process crashed (exit code $rc), retrying..."
dotnet test --project ${{ matrix.project }}.csproj -c release $flags
fi
- name: Save test outcome
if: success() || failure()
run: echo "${{ steps.test.outcome == 'success' }}," >> test.outcome
- name: Upload test outcome
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.project }}-${{ matrix.os.label }}-outcome
path: test.outcome
retention-days: 1
- name: Upload coverage report
if: matrix.os.label == 'ubuntu-latest' && env.COLLECT_COVERAGE == 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.project }}-coverage
path: src/Nethermind/artifacts/bin/${{ matrix.project }}/release/TestResults/*.cobertura.xml
retention-days: 1
tests-spec:
name: Run ${{ matrix.project }} [${{ matrix.os.label }}]
runs-on: ${{ matrix.os.runner }}
timeout-minutes: 15
continue-on-error: true
strategy:
fail-fast: false
matrix:
os:
- { runner: ubuntu-latest, label: ubuntu-latest }
- { runner: ubuntu-24.04-arm, label: ubuntu-24.04-arm }
project:
- Ethereum.Abi.Test
- Ethereum.Basic.Test
- Ethereum.Blockchain.Block.Test
- Ethereum.Difficulty.Test
- Ethereum.HexPrefix.Test
- Ethereum.KeyAddress.Test
- Ethereum.KeyStore.Test
- Ethereum.Legacy.Blockchain.Block.Test
- Ethereum.Legacy.Transition.Test
- Ethereum.Legacy.VM.Test
- Ethereum.PoW.Test
- Ethereum.Rlp.Test
- Ethereum.Transaction.Test
- Ethereum.Trie.Test
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up .NET
uses: actions/setup-dotnet@v5
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('Directory.Packages.props', 'global.json') }}
restore-keys: nuget-${{ runner.os }}-
- name: ${{ matrix.project }}
id: test
working-directory: src/Nethermind/${{ matrix.project }}
run: |
flags="${{ matrix.os.label == 'ubuntu-latest' && env.COLLECT_COVERAGE == 'true' && '--coverage --coverage-output-format cobertura --coverage-settings $GITHUB_WORKSPACE/src/Nethermind/codecoverage.config' || '' }}"
set +e
dotnet test --project ${{ matrix.project }}.csproj -c release $flags
rc=$?
set -e
if [[ $rc -eq 0 ]]; then
exit 0
elif [[ $rc -eq 1 ]]; then
exit 1
else
echo "::warning::Test process crashed (exit code $rc), retrying..."
dotnet test --project ${{ matrix.project }}.csproj -c release $flags
fi
- name: Save test outcome
if: success() || failure()
run: echo "${{ steps.test.outcome == 'success' }}," >> test.outcome
- name: Upload test outcome
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.project }}-${{ matrix.os.label }}-outcome
path: test.outcome
retention-days: 1
- name: Upload coverage report
if: matrix.os.label == 'ubuntu-latest' && env.COLLECT_COVERAGE == 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.project }}-coverage
path: src/Nethermind/artifacts/bin/${{ matrix.project }}/release/TestResults/*.cobertura.xml
retention-days: 1
tests-chunked:
name: Run ${{ matrix.test.project }} (${{ matrix.test.chunk }}) [${{ matrix.os.label }}]
runs-on: ${{ matrix.os.runner }}
timeout-minutes: 20
continue-on-error: true
strategy:
fail-fast: false
matrix:
os:
- { runner: ubuntu-latest, label: ubuntu-latest }
- { runner: ubuntu-24.04-arm, label: ubuntu-24.04-arm }
- { runner: windows-latest, label: windows-latest }
- { runner: macos-latest, label: macos-latest }
test:
- { project: Ethereum.Legacy.Blockchain.Test, chunk: 1of8 }
- { project: Ethereum.Legacy.Blockchain.Test, chunk: 2of8 }
- { project: Ethereum.Legacy.Blockchain.Test, chunk: 3of8 }
- { project: Ethereum.Legacy.Blockchain.Test, chunk: 4of8 }
- { project: Ethereum.Legacy.Blockchain.Test, chunk: 5of8 }
- { project: Ethereum.Legacy.Blockchain.Test, chunk: 6of8 }
- { project: Ethereum.Legacy.Blockchain.Test, chunk: 7of8 }
- { project: Ethereum.Legacy.Blockchain.Test, chunk: 8of8 }
- { project: Ethereum.Blockchain.Pyspec.Test, chunk: 1of4 }
- { project: Ethereum.Blockchain.Pyspec.Test, chunk: 2of4 }
- { project: Ethereum.Blockchain.Pyspec.Test, chunk: 3of4 }
- { project: Ethereum.Blockchain.Pyspec.Test, chunk: 4of4 }
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up .NET
uses: actions/setup-dotnet@v5
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('Directory.Packages.props', 'global.json') }}
restore-keys: nuget-${{ runner.os }}-
- name: ${{ matrix.test.project }} (${{ matrix.test.chunk }})
id: test
working-directory: src/Nethermind/${{ matrix.test.project }}
env:
TEST_CHUNK: ${{ matrix.test.chunk }}
run: |
set +e
dotnet test --project ${{ matrix.test.project }}.csproj -c release
rc=$?
set -e
if [[ $rc -eq 0 ]]; then
exit 0
elif [[ $rc -eq 1 ]]; then
exit 1
else
echo "::warning::Test process crashed (exit code $rc), retrying..."
dotnet test --project ${{ matrix.test.project }}.csproj -c release
fi
- name: Save test outcome
if: success() || failure()
run: echo "${{ steps.test.outcome == 'success' }}," >> test.outcome
- name: Upload test outcome
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.test.project }}-${{ matrix.test.chunk }}-${{ matrix.os.label }}-outcome
path: test.outcome
retention-days: 1
tests-summary:
name: Tests summary
needs: [tests, tests-spec, tests-chunked]
runs-on: ubuntu-latest
steps:
- name: Download test outcomes
uses: actions/download-artifact@v4
with:
path: .outcomes
pattern: '*-outcome'
- name: Ensure all tests passed
run: |
data=$(cat .outcomes/*/test.outcome) && data=${data%?}
passed=$(echo "[$data]" | jq -r 'all')
[[ "$passed" == "true" ]] && exit 0 || exit 1
codecov-upload:
name: Upload Codecov reports
needs: [tests, tests-summary]
if: needs.tests.outputs.collect_coverage == 'true'
runs-on: ubuntu-latest
steps:
- name: Download coverage reports
uses: actions/download-artifact@v4
with:
path: .coverage
pattern: '*-coverage'
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-nethermind
directory: .coverage