Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# beacon_chain
# Copyright (c) 2020-2024 Status Research & Development GmbH
# Copyright (c) 2020-2025 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
Expand Down Expand Up @@ -205,7 +205,7 @@ jobs:
# The upload creates a combined report that gets posted as a comment on the PR
# https://github.com/EnricoMi/publish-unit-test-result-action
- name: Upload combined results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Unit Test Results ${{ matrix.target.os }}-${{ matrix.target.cpu }}
path: build/*.xml
Expand Down Expand Up @@ -327,7 +327,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Event File
path: ${{ github.event_path }}
38 changes: 19 additions & 19 deletions .github/workflows/nightly_build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# beacon_chain
# Copyright (c) 2021-2024 Status Research & Development GmbH
# Copyright (c) 2021-2025 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
echo "::set-output name=archive_dir::"${NEW_ARCHIVE_DIR}

- name: Upload archive artefact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Linux_amd64_archive
path: |
Expand All @@ -50,14 +50,14 @@ jobs:
retention-days: 2

- name: Upload BN checksum artefact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Linux_amd64_checksum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_beacon_node.sha512sum
retention-days: 2

- name: Upload VC checksum artefact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Linux_amd64_checksum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_validator_client.sha512sum
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
echo "::set-output name=archive_dir::"${NEW_ARCHIVE_DIR}

- name: Upload archive artefact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Linux_arm64_archive
path: |
Expand All @@ -104,14 +104,14 @@ jobs:
retention-days: 2

- name: Upload BN checksum artefact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Linux_arm64_checksum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_beacon_node.sha512sum
retention-days: 2

- name: Upload VC checksum artefact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Linux_arm64_checksum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_validator_client.sha512sum
Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:
echo "::set-output name=archive_dir::"${NEW_ARCHIVE_DIR}

- name: Upload archive artefact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Linux_arm_archive
path: |
Expand All @@ -158,14 +158,14 @@ jobs:
retention-days: 2

- name: Upload BN checksum artefact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Linux_arm_checksum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_beacon_node.sha512sum
retention-days: 2

- name: Upload VC checksum artefact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Linux_arm_checksum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_validator_client.sha512sum
Expand Down Expand Up @@ -195,7 +195,7 @@ jobs:
echo "::set-output name=archive_dir::"${NEW_ARCHIVE_DIR}

- name: Upload archive artefact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Windows_amd64_archive
path: |
Expand All @@ -204,14 +204,14 @@ jobs:
retention-days: 2

- name: Upload BN checksum artefact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Windows_amd64_checksum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_beacon_node.sha512sum
retention-days: 2

- name: Upload VC checksum artefact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Windows_amd64_checksum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_validator_client.sha512sum
Expand Down Expand Up @@ -241,7 +241,7 @@ jobs:
echo "::set-output name=archive_dir::"${NEW_ARCHIVE_DIR}

- name: Upload archive artefact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: macOS_amd64_archive
path: |
Expand All @@ -250,14 +250,14 @@ jobs:
retention-days: 2

- name: Upload BN checksum artefact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: macOS_amd64_checksum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_beacon_node.sha512sum
retention-days: 2

- name: Upload VC checksum artefact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: macOS_amd64_checksum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_validator_client.sha512sum
Expand Down Expand Up @@ -287,7 +287,7 @@ jobs:
echo "::set-output name=archive_dir::"${NEW_ARCHIVE_DIR}

- name: Upload archive artefact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: macOS_arm64_archive
path: |
Expand All @@ -296,14 +296,14 @@ jobs:
retention-days: 2

- name: Upload BN checksum artefact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: macOS_arm64_checksum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_beacon_node.sha512sum
retention-days: 2

- name: Upload VC checksum artefact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: macOS_arm64_checksum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_validator_client.sha512sum
Expand Down
10 changes: 6 additions & 4 deletions beacon_chain/sync/sync_queue.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# beacon_chain
# Copyright (c) 2018-2024 Status Research & Development GmbH
# Copyright (c) 2018-2025 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
Expand Down Expand Up @@ -175,9 +175,11 @@ proc checkBlobsResponse*[T](req: SyncRequest[T],
# Impossible to verify empty response.
return ok()

if lenu64(data) > (req.count * MAX_BLOBS_PER_BLOCK):
static: doAssert MAX_BLOBS_PER_BLOCK_ELECTRA >= MAX_BLOBS_PER_BLOCK

if lenu64(data) > (req.count * MAX_BLOBS_PER_BLOCK_ELECTRA):
# Number of blobs in response should be less or equal to number of
# requested (blocks * MAX_BLOBS_PER_BLOCK).
# requested (blocks * MAX_BLOBS_PER_BLOCK_ELECTRA).
return err("Too many blobs received")

var
Expand All @@ -190,7 +192,7 @@ proc checkBlobsResponse*[T](req: SyncRequest[T],
return err("Incorrect order")
if slot == pslot:
inc(counter)
if counter > MAX_BLOBS_PER_BLOCK:
if counter > MAX_BLOBS_PER_BLOCK_ELECTRA:
return err("Number of blobs in the block exceeds the limit")
else:
counter = 1'u64
Expand Down
26 changes: 13 additions & 13 deletions tests/test_sync_manager.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# beacon_chain
# Copyright (c) 2020-2024 Status Research & Development GmbH
# Copyright (c) 2020-2025 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
Expand Down Expand Up @@ -35,7 +35,7 @@ func getStats(peer: SomeTPeer, index: SyncResponseKind): uint64 =
0

func getStaticSlotCb(slot: Slot): GetSlotCallback =
proc getSlot(): Slot =
func getSlot(): Slot =
slot
getSlot

Expand All @@ -60,7 +60,7 @@ func collector(queue: AsyncQueue[BlockEntry]): BlockVerifier =
return verify

suite "SyncManager test suite":
proc createChain(start, finish: Slot): seq[ref ForkedSignedBeaconBlock] =
func createChain(start, finish: Slot): seq[ref ForkedSignedBeaconBlock] =
doAssert(start <= finish)
let count = int(finish - start + 1'u64)
var res = newSeq[ref ForkedSignedBeaconBlock](count)
Expand Down Expand Up @@ -98,7 +98,7 @@ suite "SyncManager test suite":
inc sidecarIdx
res

proc getSlice(chain: openArray[ref ForkedSignedBeaconBlock], startSlot: Slot,
func getSlice(chain: openArray[ref ForkedSignedBeaconBlock], startSlot: Slot,
request: SyncRequest[SomeTPeer]): seq[ref ForkedSignedBeaconBlock] =
let
startIndex = int(request.slot - startSlot)
Expand Down Expand Up @@ -488,7 +488,7 @@ suite "SyncManager test suite":
else:
sblock.fail(VerifierError.Duplicate)

proc getBackwardSafeSlotCb(): Slot =
func getBackwardSafeSlotCb(): Slot =
min((Slot(counter).epoch + 1).start_slot, finish)

proc forwardValidator(aq: AsyncQueue[BlockEntry]) {.async.} =
Expand All @@ -503,7 +503,7 @@ suite "SyncManager test suite":
else:
sblock.fail(VerifierError.Duplicate)

proc getFowardSafeSlotCb(): Slot =
func getFowardSafeSlotCb(): Slot =
max(Slot(max(counter, 1) - 1).epoch.start_slot, start)

var
Expand Down Expand Up @@ -578,11 +578,11 @@ suite "SyncManager test suite":
let sblock = await aq.popFirst()
sblock.fail(VerifierError.Invalid)

proc getBackwardSafeSlotCb(): Slot =
func getBackwardSafeSlotCb(): Slot =
let progress = (uint64(int(finish) - counter) div chunkSize) * chunkSize
finish - progress

proc getFowardSafeSlotCb(): Slot =
func getFowardSafeSlotCb(): Slot =
let progress = (uint64(counter - int(start)) div chunkSize) * chunkSize
start + progress

Expand Down Expand Up @@ -909,7 +909,7 @@ suite "SyncManager test suite":
lastSafeSlot = finishSlot
counter = int(finishSlot)

proc getSafeSlot(): Slot =
func getSafeSlot(): Slot =
lastSafeSlot

proc backwardValidator(aq: AsyncQueue[BlockEntry]) {.async.} =
Expand Down Expand Up @@ -1040,7 +1040,7 @@ suite "SyncManager test suite":
check sr.getLastNonEmptySlot() == Slot(100)

test "[SyncQueue] contains() test":
proc checkRange[T](req: SyncRequest[T]): bool =
func checkRange[T](req: SyncRequest[T]): bool =
var slot = req.slot
var counter = 0'u64
while counter < req.count:
Expand Down Expand Up @@ -1115,9 +1115,9 @@ suite "SyncManager test suite":
r2 = SyncRequest[SomeTPeer](slot: Slot(11), count: 2'u64)
r3 = SyncRequest[SomeTPeer](slot: Slot(11), count: 3'u64)

d1 = Slot(11).repeat(MAX_BLOBS_PER_BLOCK)
d2 = Slot(12).repeat(MAX_BLOBS_PER_BLOCK)
d3 = Slot(13).repeat(MAX_BLOBS_PER_BLOCK)
d1 = Slot(11).repeat(MAX_BLOBS_PER_BLOCK_ELECTRA)
d2 = Slot(12).repeat(MAX_BLOBS_PER_BLOCK_ELECTRA)
d3 = Slot(13).repeat(MAX_BLOBS_PER_BLOCK_ELECTRA)

check:
checkBlobsResponse(r1, [Slot(11)]).isOk() == true
Expand Down