11# Nimbus
2- # Copyright (c) 2024-2025 Status Research & Development GmbH
2+ # Copyright (c) 2024-2026 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)
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
1313import
1414 std/ [tables, algorithm, strformat],
@@ -78,7 +78,7 @@ func appendBlock(c: ForkedChainRef,
7878 c.heads.add newBlock
7979 newBlock
8080
81- proc fcuSetHead (c: ForkedChainRef ,
81+ func fcuSetHead (c: ForkedChainRef ,
8282 txFrame: CoreDbTxRef ,
8383 header: Header ,
8484 hash: Hash32 ,
@@ -196,7 +196,7 @@ func calculateNewBase(
196196
197197 doAssert (false , " Unreachable code, target base should exists" )
198198
199- proc removeBlockFromCache (c: ForkedChainRef , b: BlockRef ) =
199+ func removeBlockFromCache (c: ForkedChainRef , b: BlockRef ) =
200200 c.hashToBlock.del (b.hash)
201201 for tx in b.blk.transactions:
202202 c.txRecords.del (computeRlpHash (tx))
@@ -210,15 +210,15 @@ proc removeBlockFromCache(c: ForkedChainRef, b: BlockRef) =
210210 # Clear parent and let GC claim the memory earlier
211211 b.parent = nil
212212
213- proc updateHead (c: ForkedChainRef , head: BlockRef ) =
213+ func updateHead (c: ForkedChainRef , head: BlockRef ) =
214214 # # Update head if the new head is different from current head.
215215
216216 c.fcuSetHead (head.txFrame,
217217 head.header,
218218 head.hash,
219219 head.number)
220220
221- proc updateFinalized (c: ForkedChainRef , finalized: BlockRef , fcuHead: BlockRef ) =
221+ func updateFinalized (c: ForkedChainRef , finalized: BlockRef , fcuHead: BlockRef ) =
222222 # Pruning
223223 # ::
224224 # - B5 - B6 - B7 - B8
@@ -617,6 +617,7 @@ proc init*(
617617 persistBatchSize = PersistBatchSize ;
618618 dynamicBatchSize = false ;
619619 eagerStateRoot = false ;
620+ maxBlobs = none (uint8 );
620621 enableQueue = false ;
621622 ): T =
622623 # # Constructor that uses the current database ledger state for initialising.
@@ -658,6 +659,7 @@ proc init*(
658659 baseDistance: baseDistance,
659660 persistBatchSize: persistBatchSize,
660661 dynamicBatchSize: dynamicBatchSize,
662+ maxBlobs: maxBlobs,
661663 quarantine: Quarantine .init (),
662664 fcuHead: fcuHead,
663665 fcuSafe: fcuSafe,
0 commit comments