Skip to content

Commit f53815c

Browse files
committed
Merge remote-tracking branch 'origin/master' into wip-nimbus
2 parents fc835f4 + 8c6f55a commit f53815c

File tree

14 files changed

+135
-34
lines changed

14 files changed

+135
-34
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252

5353
- name: Extract branch name
5454
id: extract_branch
55-
run: echo "branch_name=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
55+
run: echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
5656

5757
- name: Build project
5858
id: make_dist
@@ -61,7 +61,7 @@ jobs:
6161
cd dist
6262
ARCHIVE=$(echo *.tar.gz)
6363
tar -xzf ${ARCHIVE}
64-
NEW_ARCHIVE_DIR="nimbus-eth1-${{ matrix.os }}-${{ matrix.cpu }}-${{ steps.extract_branch.outputs.branch_name }}-$(git rev-parse --short=8 HEAD)"
64+
NEW_ARCHIVE_DIR="nimbus-eth1-${{ matrix.os }}-${{ matrix.cpu }}-${{ steps.extract_branch.outputs.tag_name }}-$(git rev-parse --short=8 HEAD)"
6565
mv ${ARCHIVE%.tar.gz} ${NEW_ARCHIVE_DIR}
6666
tar -czf ${NEW_ARCHIVE_DIR}.tar.gz ${NEW_ARCHIVE_DIR}
6767
cp ${NEW_ARCHIVE_DIR}.tar.gz nimbus-eth1-${{ matrix.os }}-${{ matrix.cpu }}.tar.gz
@@ -116,7 +116,7 @@ jobs:
116116

117117
- name: Extract branch name
118118
id: extract_branch
119-
run: echo "branch_name=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
119+
run: echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
120120

121121
- name: Create release notes
122122
run: |
@@ -145,7 +145,7 @@ jobs:
145145
with:
146146
draft: true
147147
prerelease: false
148-
name: 'Release build ("${{ steps.extract_branch.outputs.branch_name }}" branch)'
148+
name: 'Release build ("${{ steps.extract_branch.outputs.tag_name }}")'
149149
body_path: release_notes.md
150150
files: |
151151
linux-amd64-archive/*

execution_chain/core/chain/forked_chain.nim

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,13 @@ proc validateBlock(c: ForkedChainRef,
447447
c.latestFinalizedBlockNumber)
448448

449449
let
450+
# As a memory optimization we move the HashKeys (kMap) stored in the
451+
# parent txFrame to the new txFrame unless the block number is one
452+
# greater than a block which is expected to be persisted based on the
453+
# persistBatchSize
454+
moveParentHashKeys = c.persistBatchSize > 1 and (blk.header.number mod c.persistBatchSize) != 1
450455
parentFrame = parent.txFrame
451-
txFrame = parentFrame.txFrameBegin
456+
txFrame = parentFrame.txFrameBegin(moveParentHashKeys)
452457

453458
# TODO shortLog-equivalent for eth types
454459
debug "Validating block",

execution_chain/core/gaslimit.nim

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Nimbus
2-
# Copyright (c) 2018-2024 Status Research & Development GmbH
2+
# Copyright (c) 2018-2025 Status Research & Development GmbH
33
# Licensed under either of
44
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
55
# http://www.apache.org/licenses/LICENSE-2.0)
@@ -54,8 +54,7 @@ proc calcEip1599BaseFee*(com: CommonRef; parent: Header): UInt256 =
5454

5555
# consensus/misc/eip1559.go(32): func VerifyEip1559Header(config [..]
5656
proc verifyEip1559Header(com: CommonRef;
57-
parent, header: Header): Result[void, string]
58-
{.raises: [].} =
57+
parent, header: Header): Result[void, string] =
5958
## Verify that the gas limit remains within allowed bounds
6059
let limit = if com.isLondonOrLater(parent.number):
6160
parent.gasLimit

execution_chain/core/tx_pool/tx_desc.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ proc classifyValid(xp: TxPoolRef; tx: Transaction, sender: Address): bool =
235235
true
236236

237237
proc validateBlobTransactionWrapper(tx: PooledTransaction, fork: EVMFork):
238-
Result[void, string] {.raises: [].} =
238+
Result[void, string] =
239239
if tx.blobsBundle.isNil:
240240
return err("tx wrapper is none")
241241

execution_chain/core/validate.nim

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ proc validateHeader(
102102
ok()
103103

104104
proc validateUncles(com: CommonRef; header: Header; txFrame: CoreDbTxRef,
105-
uncles: openArray[Header]): Result[void,string]
106-
{.gcsafe, raises: [].} =
105+
uncles: openArray[Header]): Result[void,string] =
107106
let hasUncles = uncles.len > 0
108107
let shouldHaveUncles = header.ommersHash != EMPTY_UNCLE_HASH
109108

@@ -376,8 +375,7 @@ proc validateHeaderAndKinship*(
376375
blk: Block;
377376
parent: Header;
378377
txFrame: CoreDbTxRef
379-
): Result[void, string]
380-
{.gcsafe, raises: [].} =
378+
): Result[void, string] =
381379
template header: Header = blk.header
382380

383381
if header.isGenesis:

execution_chain/db/aristo/aristo_profile.nim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ proc updateTotal(t: AristoDbProfListRef; fnInx: uint) =
6161

6262
# ---------------------
6363

64-
func ppUs(elapsed: Duration): string {.gcsafe, raises: [].} =
64+
func ppUs(elapsed: Duration): string =
6565
result = $elapsed.inMicroseconds
6666
let ns = elapsed.inNanoseconds mod 1_000 # fraction of a micro second
6767
if ns != 0:
@@ -70,7 +70,7 @@ func ppUs(elapsed: Duration): string {.gcsafe, raises: [].} =
7070
result &= &".{du:02}"
7171
result &= "us"
7272

73-
func ppMs(elapsed: Duration): string {.gcsafe, raises: [].} =
73+
func ppMs(elapsed: Duration): string =
7474
result = $elapsed.inMilliseconds
7575
let ns = elapsed.inNanoseconds mod 1_000_000 # fraction of a milli second
7676
if ns != 0:
@@ -79,7 +79,7 @@ func ppMs(elapsed: Duration): string {.gcsafe, raises: [].} =
7979
result &= &".{dm:02}"
8080
result &= "ms"
8181

82-
func ppSecs(elapsed: Duration): string {.gcsafe, raises: [].} =
82+
func ppSecs(elapsed: Duration): string =
8383
result = $elapsed.inSeconds
8484
let ns = elapsed.inNanoseconds mod 1_000_000_000 # fraction of a second
8585
if ns != 0:
@@ -88,7 +88,7 @@ func ppSecs(elapsed: Duration): string {.gcsafe, raises: [].} =
8888
result &= &".{ds:02}"
8989
result &= "s"
9090

91-
func ppMins(elapsed: Duration): string {.gcsafe, raises: [].} =
91+
func ppMins(elapsed: Duration): string =
9292
result = $elapsed.inMinutes
9393
let ns = elapsed.inNanoseconds mod 60_000_000_000 # fraction of a minute
9494
if ns != 0:

execution_chain/db/aristo/aristo_tx_frame.nim

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,15 @@ proc buildSnapshot(txFrame: AristoTxRef, minLevel: int) =
9191

9292
txFrame.snapshot.level = Opt.some(minLevel)
9393

94-
proc txFrameBegin*(db: AristoDbRef, parent: AristoTxRef): AristoTxRef =
94+
proc txFrameBegin*(db: AristoDbRef, parent: AristoTxRef, moveParentHashKeys = false): AristoTxRef =
9595
let parent = if parent == nil: db.txRef else: parent
96-
AristoTxRef(db: db, parent: parent, vTop: parent.vTop, level: parent.level + 1)
96+
97+
AristoTxRef(
98+
db: db,
99+
parent: parent,
100+
kMap: if moveParentHashKeys: move(parent.kMap) else: default(parent.kMap.type),
101+
vTop: parent.vTop,
102+
level: parent.level + 1)
97103

98104
proc dispose*(tx: AristoTxRef) =
99105
tx[].reset()

execution_chain/db/core_db/base.nim

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,16 +455,19 @@ proc txFrameBegin*(db: CoreDbRef): CoreDbTxRef =
455455
##
456456
let
457457
kTx = db.kvt.txFrameBegin(nil)
458-
aTx = db.mpt.txFrameBegin(nil)
458+
aTx = db.mpt.txFrameBegin(nil, false)
459459

460460
CoreDbTxRef(kTx: kTx, aTx: aTx)
461461

462-
proc txFrameBegin*(parent: CoreDbTxRef): CoreDbTxRef =
462+
proc txFrameBegin*(
463+
parent: CoreDbTxRef,
464+
moveParentHashKeys = false
465+
): CoreDbTxRef =
463466
## Constructor
464467
##
465468
let
466469
kTx = parent.kTx.db.txFrameBegin(parent.kTx)
467-
aTx = parent.aTx.db.txFrameBegin(parent.aTx)
470+
aTx = parent.aTx.db.txFrameBegin(parent.aTx, moveParentHashKeys)
468471

469472
CoreDbTxRef(kTx: kTx, aTx: aTx)
470473

execution_chain/db/payload_body_db.nim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ proc getExecutionPayloadBodyV1*(
5454
var wds: seq[WithdrawalV1]
5555
body.withdrawals = Opt.some(wds)
5656
return ok(move(body))
57-
57+
5858
wrapRlpException info:
5959
let bytes = db.get(withdrawalsKey(withdrawalsRoot).toOpenArray).valueOr:
6060
if error.error != KvtNotFound:
@@ -66,13 +66,13 @@ proc getExecutionPayloadBodyV1*(
6666
wds.add(wd)
6767
body.withdrawals = Opt.some(wds)
6868
return ok(move(body))
69-
69+
7070
var list = rlp.decode(bytes, seq[WithdrawalV1])
7171
body.withdrawals = Opt.some(move(list))
7272

7373
ok(move(body))
7474

75-
func toPayloadBody*(blk: Block): ExecutionPayloadBodyV1 {.raises:[].} =
75+
func toPayloadBody*(blk: Block): ExecutionPayloadBodyV1 =
7676
var wds: seq[WithdrawalV1]
7777
if blk.withdrawals.isSome:
7878
for w in blk.withdrawals.get:

execution_chain/evm/interpreter/op_handlers/oph_create.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import
3838
# ------------------------------------------------------------------------------
3939

4040
proc execSubCreate(c: Computation; childMsg: Message;
41-
code: CodeBytesRef) {.raises: [].} =
41+
code: CodeBytesRef) =
4242
## Create new VM -- helper for `Create`-like operations
4343

4444
# need to provide explicit <c> and <child> for capturing in chainTo proc()

0 commit comments

Comments
 (0)