Skip to content

Commit 80ddb54

Browse files
authored
unhide deprecation warnings (#3725)
1 parent 1ec0006 commit 80ddb54

File tree

7 files changed

+18
-19
lines changed

7 files changed

+18
-19
lines changed

config.nims

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,6 @@ switch("hintAsError", "DuplicateModuleImport:on")
165165
# `switch("warning[CaseTransition]", "off")` fails with "Error: invalid command line option: '--warning[CaseTransition]'"
166166
switch("warning", "CaseTransition:off")
167167

168-
# Transitional for Nim v2.2, due to newSeqUninit replacing newSeqUninitialized.
169-
switch("warning", "Deprecated:off")
170-
171168
# nim-kzg shipping their own blst, nimbus-eth1 too.
172169
# disable nim-kzg's blst
173170
switch("define", "kzgExternalBlst")

execution_chain/core/block_import.nim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# This file may not be copied, modified, or distributed except according to
88
# those terms.
99

10-
{.push raises: [].}
10+
{.push raises: [], gcsafe.}
1111

1212
import
1313
chronicles,
@@ -54,14 +54,14 @@ proc importRlpBlocks*(blocksRlp:seq[byte],
5454

5555
if not printBanner:
5656
info "Start importing block",
57-
hash=blk.header.blockHash.short,
57+
hash=blk.header.computeBlockHash.short,
5858
number=blk.header.number
5959
printBanner = true
6060

6161
let res = await chain.importBlock(blk, finalized = false)
6262
if res.isErr:
6363
error "Error occured when importing block",
64-
hash=blk.header.blockHash.short,
64+
hash=blk.header.computeBlockHash.short,
6565
number=blk.header.number,
6666
msg=res.error
6767
if finalize:

execution_chain/core/chain/persist_blocks.nim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# at your option. This file may not be copied, modified, or distributed except
99
# according to those terms.
1010

11-
{.push raises: [].}
11+
{.push raises: [], gcsafe.}
1212

1313
import
1414
stew/assign2,
@@ -79,11 +79,11 @@ proc getVmState(
7979

8080
ok(p.vmState)
8181

82-
proc dispose*(p: var Persister) =
82+
func dispose*(p: var Persister) =
8383
p.vmState.ledger.txFrame.dispose()
8484
p.vmState = nil
8585

86-
proc init*(T: type Persister, com: CommonRef, flags: PersistBlockFlags): T =
86+
func init*(T: type Persister, com: CommonRef, flags: PersistBlockFlags): T =
8787
T(com: com, flags: flags)
8888

8989
proc checkpoint*(p: var Persister): Result[void, string] =
@@ -95,7 +95,7 @@ proc checkpoint*(p: var Persister): Result[void, string] =
9595
# TODO replace logging with better error
9696
debug "wrong state root in block",
9797
blockNumber = p.parent.number,
98-
blockHash = p.parent.blockHash,
98+
blockHash = p.parent.computeBlockHash,
9999
parentHash = p.parent.parentHash,
100100
expected = p.parent.stateRoot,
101101
actual = stateRoot

execution_chain/core/eip4844.nim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
# at your option. This file may not be copied, modified, or distributed except
99
# according to those terms.
1010

11+
{.push raises: [], gcsafe.}
12+
1113
import
1214
stew/arrayops,
1315
nimcrypto/sha2,
@@ -24,8 +26,6 @@ from std/sequtils import mapIt
2426
export
2527
kzg
2628

27-
{.push raises: [].}
28-
2929
type
3030
Bytes64 = array[64, byte]
3131

@@ -204,7 +204,7 @@ proc validateBlobTransactionWrapper4844*(tx: PooledTransaction):
204204

205205
# Verify that commitments match the blobs by checking the KZG proof
206206
let res = kzg.verifyBlobKzgProofBatch(
207-
tx.blobsBundle.blobs.mapIt(kzg.KzgBlob(bytes: it.bytes)),
207+
tx.blobsBundle.blobs.mapIt(kzg.KzgBlob(bytes: it.data)),
208208
commitments,
209209
tx.blobsBundle.proofs.mapIt(kzg.KzgProof(bytes: it.data)))
210210

execution_chain/core/executor/process_block.nim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ proc procBlkEpilogue(
220220
# TODO replace logging with better error
221221
debug "wrong state root in block",
222222
blockNumber = header.number,
223-
blockHash = header.blockHash,
223+
blockHash = header.computeBlockHash,
224224
parentHash = header.parentHash,
225225
expected = header.stateRoot,
226226
actual = stateRoot,
@@ -242,7 +242,7 @@ proc procBlkEpilogue(
242242
debug "wrong receiptRoot in block",
243243
blockNumber = header.number,
244244
parentHash = header.parentHash.short,
245-
blockHash = header.blockHash.short,
245+
blockHash = header.computeBlockHash.short,
246246
actual = receiptsRoot,
247247
expected = header.receiptsRoot
248248
return err("receiptRoot mismatch")
@@ -263,7 +263,7 @@ proc procBlkEpilogue(
263263
debug "wrong requestsHash in block",
264264
blockNumber = header.number,
265265
parentHash = header.parentHash.short,
266-
blockHash = header.blockHash.short,
266+
blockHash = header.computeBlockHash.short,
267267
actual = requestsHash,
268268
expected = header.requestsHash.get
269269
return err("requestsHash mismatch")

execution_chain/core/pooled_txs_rlp.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# This file may not be copied, modified, or distributed except according to
88
# those terms.
99

10-
{.push raises: [].}
10+
{.push raises: [], gcsafe.}
1111

1212
import
1313
eth/common/transactions_rlp {.all.},
@@ -42,7 +42,7 @@ proc append*(w: var RlpWriter, tx: PooledTransaction) =
4242
w.append(tx.blobsBundle)
4343

4444
proc read(rlp: var Rlp, T: type Blob): T {.raises: [RlpError].} =
45-
rlp.read(result.bytes)
45+
rlp.read(result.data)
4646

4747
proc readTxTyped(rlp: var Rlp, tx: var PooledTransaction) {.raises: [RlpError].} =
4848
let

tests/test_txpool.nim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
# at your option. This file may not be copied, modified, or distributed except
99
# according to those terms.
1010

11+
{.push raises: [].}
12+
1113
import
1214
std/math,
1315
eth/common/keys,
@@ -253,7 +255,7 @@ suite "TxPool test suite":
253255
blobID: 0.BlobID
254256
)
255257
var ptx = mx.makeTx(tc, 0)
256-
var z = ptx.blobsBundle.blobs[0].bytes
258+
var z = ptx.blobsBundle.blobs[0].data
257259
z[0] = not z[0]
258260
ptx.blobsBundle.blobs[0] = pooled_txs.KzgBlob z
259261
xp.checkAddTx(ptx, txErrorInvalidBlob)

0 commit comments

Comments
 (0)