Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
fcfae5d
unify types with Geth
Dyslex7c Jun 8, 2026
adc1397
merge with master
Dyslex7c Jun 8, 2026
df93fb5
fix CI build error
Dyslex7c Jun 8, 2026
95c13e7
address review comments, fix tests and build, reduce casts
Dyslex7c Jun 9, 2026
7a0d71b
merge with master
Dyslex7c Jun 9, 2026
38a1990
fix(rpc): align trace tests with Prague gas specification, fix log fi…
Dyslex7c Jun 10, 2026
8a07217
fix(build): align test suites and plugins with unified type changes
Dyslex7c Jun 10, 2026
59be11d
fix overflow/underflow errors in tests
Dyslex7c Jun 10, 2026
ab91004
merge with master
Dyslex7c Jun 10, 2026
ff41008
fix tests
Dyslex7c Jun 10, 2026
d715ecc
Merge remote-tracking branch 'upstream/master' into unify-geth-types
Dyslex7c Jun 10, 2026
331535e
fix build and tests
Dyslex7c Jun 10, 2026
d33b214
fix tests
Dyslex7c Jun 10, 2026
466fd42
fix Evm and blockchain tests
Dyslex7c Jun 11, 2026
a6fabc5
refactor(evm): introduce `SaturatingSub` helper to simplify `ulong` s…
Dyslex7c Jun 11, 2026
dbb796c
fix blockchain tests
Dyslex7c Jun 11, 2026
3373d8e
Merge remote-tracking branch 'upstream/master' into unify-geth-types
Dyslex7c Jun 11, 2026
11e1094
fix(ethash): align difficulty bomb exponent cap with Geth's 256-bit l…
Dyslex7c Jun 11, 2026
33c365e
Merge remote-tracking branch 'upstream/master' into unify-geth-types
Dyslex7c Jun 11, 2026
b61f2ef
fix(era1): resolve `BlockTreeSuggestPacer` underflow and test boundar…
Dyslex7c Jun 11, 2026
a862cfd
fix(init): resolve `ReceiptMigration` ulong countdown loop underflows
Dyslex7c Jun 11, 2026
c714b14
Merge remote-tracking branch 'upstream/master' into unify-geth-types
Dyslex7c Jun 15, 2026
1c77acf
fix: resolve type unification build errors and taiko tests and clean …
Dyslex7c Jun 15, 2026
46a5890
refactor: unify Geth types and fix EIP-8037/EIP-7702 test regressions
Dyslex7c Jun 16, 2026
0fd9dce
Merge branch 'master' into unify-geth-types
LukaszRozmej Jun 17, 2026
b781898
fix(geth-types): address review findings — unsigned-underflow guards …
LukaszRozmej Jun 17, 2026
ce4b805
refactor(geth-types): cast cleanup pass
LukaszRozmej Jun 17, 2026
5e6dde7
fix(build): remove dangling reference to deleted SszNumericChecks, li…
LukaszRozmej Jun 17, 2026
2ec13bc
fix(eip8037): restore master's Validate semantics to unblock Pyspec
LukaszRozmej Jun 17, 2026
539cd12
test(eip8037): align inclusion check tests with master's worst-case f…
LukaszRozmej Jun 17, 2026
079d1c8
fix(geth-types): post-review HIGH/MEDIUM/NIT fixes
LukaszRozmej Jun 17, 2026
2d14709
Merge remote-tracking branch 'upstream/master' into unify-geth-types
Dyslex7c Jun 17, 2026
21938e5
fix(json-serialization): reject leading zeros in hex quantities and c…
Dyslex7c Jun 17, 2026
a51af91
refactor: address review comments on casts, comments, and hex quantit…
Dyslex7c Jun 18, 2026
bcbbb71
refactor(aura,state): address review comments on block finalization, …
Dyslex7c Jun 18, 2026
d04b5a4
refactor: unify block number, nonce, and gas types to unsigned types
Dyslex7c Jun 18, 2026
ebea5d0
refactor: unify block number, nonce, and gas types to unsigned types
Dyslex7c Jun 18, 2026
e709a02
refactor: geth type unification and unsigned overflow/underflow fixes
Dyslex7c Jun 18, 2026
a3a56c5
Merge remote-tracking branch 'upstream/master' into unify-geth-types
Dyslex7c Jun 18, 2026
2e70f2d
fix(json): chainspec hex parsing rejecting valid leading-zero forms
LukaszRozmej Jun 19, 2026
151f170
nit(json): strip remarks block on NumericConverterHelper.Parse
LukaszRozmej Jun 19, 2026
cee81ba
fix(evm): restore signed-refund semantics so EIP-2200/3529 sub-below-…
LukaszRozmej Jun 19, 2026
a8b96c1
fix(evm): VmState/Substate Refund back to signed long for EIP-2200/35…
LukaszRozmej Jun 19, 2026
d23ceae
review: SaturatingSub for spill, drop redundant ParseLax / strict 0x0…
LukaszRozmej Jun 19, 2026
492f8b0
Apply suggestions from code review
LukaszRozmej Jun 19, 2026
e358c7c
review: address PR comments — cleaner ulong typing, drop dead code/co…
LukaszRozmej Jun 19, 2026
46c8d57
review(config): drop the special ulong branch that silently wrapped -1
LukaszRozmej Jun 19, 2026
1831571
refactor: drop redundant casts and cascade ulong further
LukaszRozmej Jun 19, 2026
06cb7f4
review: misc unsigned-type tightening, strip cast comments, fix div-b…
LukaszRozmej Jun 19, 2026
523f83e
review: misc ulong-tightening + strip noisy "cast safe" comments
LukaszRozmej Jun 19, 2026
441a4aa
review: ulong-ify retention spec + RLP encode(ulong), SaturatingSub u…
LukaszRozmej Jun 19, 2026
9ee3a91
review: restore Json converter special cases; ulong MemoryHint/MaxGas…
LukaszRozmej Jun 19, 2026
553420f
review: more ulong cascades + SaturatingSub + ToULong byte-span helper
LukaszRozmej Jun 19, 2026
9865282
review: revert GetBlobCount to int + Optimism/Migration/Simulate clea…
LukaszRozmej Jun 19, 2026
99e1b93
review: HeaderDecoder ulong + receipt ToULong + comment strip
LukaszRozmej Jun 19, 2026
d9bc1b2
review: EthCapabilities ulong end-to-end + EthSimulate test cleanup
LukaszRozmej Jun 19, 2026
7fdffff
review: cleanup ulong test types and receipt-index check
LukaszRozmej Jun 19, 2026
594bf80
review: strip noise comments, add int WithNumber overloads, Saturatin…
LukaszRozmej Jun 19, 2026
c177297
review: more comment/style cleanups
LukaszRozmej Jun 19, 2026
86078fe
review: explicit (int) array size, fold ulong-aware Math.Min into Unc…
LukaszRozmej Jun 19, 2026
5bd99b1
review(test): drop redundant (ulong) cast in Capabilities scenario bu…
LukaszRozmej Jun 19, 2026
26af56c
review(state.flat): strip stale comments; PersistenceManager depth/si…
LukaszRozmej Jun 19, 2026
7ddcf2b
review(specs): ulong types, drop noise comments and unused converter
LukaszRozmej Jun 19, 2026
b65b34a
review(state): nonce + balance type fixes; restore DifficultyBombDela…
LukaszRozmej Jun 19, 2026
b44b5dd
review(taiko/trie/state): ulong cascade for precompile contract; Satu…
LukaszRozmej Jun 19, 2026
2104531
review(sync): SaturatingSub, ulong skipLastN/maxHeaders/fastSyncLag, …
LukaszRozmej Jun 19, 2026
491701a
review(sync.merge): ulong cascade in WithBlockTrees/test scenarios, u…
LukaszRozmej Jun 19, 2026
5e5e35b
review(sync.test): fastSynclag/effectiveHead/headNumber ulong, strip …
LukaszRozmej Jun 19, 2026
68073b3
review(sync.test): ulong types and cast-free arg lookups
LukaszRozmej Jun 19, 2026
722a299
refactor: unify blockchain metrics, limits, and validation types to u…
Dyslex7c Jun 21, 2026
19a5f34
review(sync.test): more ulong cascades, SaturatingSub in BuildNewBatch
LukaszRozmej Jun 22, 2026
52acba9
review: strip remaining 'not visited sentinel' narration in HeadersSy…
LukaszRozmej Jun 22, 2026
9032e28
review: strip more 'X is ulong'/'cast is safe' narration in sync code
LukaszRozmej Jun 22, 2026
771050b
review: strip last 'no cast needed' comment in HeadersSyncFeed
LukaszRozmej Jun 22, 2026
ee2a483
review(config): restore ulong backward-compat branch in ConfigSourceH…
LukaszRozmej Jun 22, 2026
03df41d
review: drop ulong unchecked-wrap from ConfigSourceHelper; ulong-awar…
LukaszRozmej Jun 22, 2026
ea0209d
review: strip more 'safe cast' narration in AuRa/Blockchain/History
LukaszRozmej Jun 22, 2026
b004490
review: strip more 'safe cast'/'safe to' narration
LukaszRozmej Jun 22, 2026
4fe5642
review: strip ERROR FIX / widening-cast narration
LukaszRozmej Jun 22, 2026
adf646d
review: strip last 'migration narration' comments
LukaszRozmej Jun 22, 2026
52da253
review(trie): replace signed-long pruning-boundary round-trip with Sa…
LukaszRozmej Jun 22, 2026
dda9998
review: replace 8 more ternary-clamp patterns with SaturatingSub
LukaszRozmej Jun 22, 2026
1fbc115
review: replace 6 more ternary-clamp patterns with SaturatingSub
LukaszRozmej Jun 22, 2026
8d6ccf7
review(xdc): 2 more ternary-clamp → SaturatingSub (TimeoutCertificate…
LukaszRozmej Jun 22, 2026
52e2c42
review: strip last batch of migration-narration comments
LukaszRozmej Jun 22, 2026
87a87d3
review(trie): delete identity helpers + strip last narration comments
LukaszRozmej Jun 22, 2026
4dddc34
review: condense remaining gas/header migration comments
LukaszRozmej Jun 22, 2026
06f1e4c
review: strip more 'cast/subtraction is safe' narration; SaturatingSu…
LukaszRozmej Jun 22, 2026
d0c66bd
review: strip more 'previously long' / loop-narration comments
LukaszRozmej Jun 22, 2026
33c5c65
review(consensus): tighten HeaderValidator overflow-detection comment
LukaszRozmej Jun 22, 2026
ab5ef6b
review(sync.test): drop more (ulong) casts on fastSyncLag/blocksToIgnore
LukaszRozmej Jun 22, 2026
43419f0
review(test): drop one more (ulong)retention cast in Capabilities sce…
LukaszRozmej Jun 22, 2026
f9748e5
review(test): drop (ulong)i casts at WithNumber sites with new int ov…
LukaszRozmej Jun 22, 2026
2afbca5
review(sync.test): headNumber/notSyncedTreeStartingBlockNumber cascad…
LukaszRozmej Jun 22, 2026
3c0e5a0
review(aura.test): use UnixTime.Milliseconds (ulong) instead of (ulon…
LukaszRozmej Jun 22, 2026
c0a6ea1
review(core): make Eip7702Constants.PerAuthBaseCost ulong; drop redun…
LukaszRozmej Jun 22, 2026
23cd037
review(test): drop (int)chainLength casts at OfChainLength call sites…
LukaszRozmej Jun 22, 2026
353b044
review(trie): tighten CanDelete sentinel comment
LukaszRozmej Jun 22, 2026
fa7c63d
review(test): drop 'Sentinel: brokenLevel == ulong.MaxValue' narration
LukaszRozmej Jun 22, 2026
238cd0d
refactor(xdc.test): simplify Snapshot type references in state sync t…
Dyslex7c Jun 22, 2026
d2927e7
Merge remote-tracking branch 'upstream/master' into unify-geth-types
Dyslex7c Jun 22, 2026
e06e670
fix(merge): rebase fallout — ulong gas in GethLikeTxMemoryTracer/Stre…
LukaszRozmej Jun 22, 2026
4c1ba08
fix(evm.test): rebase fallout — ulong types in two new master tests
LukaszRozmej Jun 22, 2026
5150e21
review: 5 more ternary-clamp → SaturatingSub
LukaszRozmej Jun 22, 2026
397483d
review: 6 more ternary-clamp → SaturatingSub
LukaszRozmej Jun 22, 2026
ca0fd45
review: more ternary-clamp → SaturatingSub
LukaszRozmej Jun 22, 2026
6336ce4
review(merge.sync): ChainLevelHelper.GetStartingPoint use ulong.MaxVa…
LukaszRozmej Jun 22, 2026
ac312f3
review(history): strip 2 more 'still returns long' / 'Rlp.Encode(long…
LukaszRozmej Jun 23, 2026
1e4cd34
review(sync.test): test expected-block params cascade long → ulong
LukaszRozmej Jun 23, 2026
598d758
review(aura): AuraHealthHintService.CurrentStepDuration return ulong,…
LukaszRozmej Jun 23, 2026
966be65
review(xdc.test): SpecialTransactionsTests lower bound → SaturatingSu…
LukaszRozmej Jun 23, 2026
4d0b9f8
review(trie): tighten pruning-boundary comment — drop 'old signed lon…
LukaszRozmej Jun 23, 2026
95db54c
review(test): drop narrowing (int) casts in AccountDecoderTests; comp…
LukaszRozmej Jun 23, 2026
92fe645
review: drop narration & redundant casts
LukaszRozmej Jun 23, 2026
12c7a74
review(gas-estimator): restore double margin math
LukaszRozmej Jun 23, 2026
87118bd
review(log-index): restore order-tolerant Max/Min clamp
LukaszRozmej Jun 23, 2026
8b636f6
review(txpool): restore UInt256 decode in LightTxDecoder
LukaszRozmej Jun 23, 2026
5690167
review(optimism): restore UInt256 decode for deposit-tx Value
LukaszRozmej Jun 23, 2026
aa45001
review(aura): IsZeroGasPrice keep MaxFeePerGas semantics
LukaszRozmej Jun 23, 2026
37159ea
review: guard FeeHistory floor + unsigned subtractions
LukaszRozmej Jun 23, 2026
71f189e
review(xdc): use Interlocked.Read instead of CAS-with-same-args
LukaszRozmej Jun 23, 2026
3ed6604
review(aura): TxGasPriceSender keep UInt256 estimate
LukaszRozmej Jun 23, 2026
9293eee
review(progress-logger): cast to decimal before subtracting
LukaszRozmej Jun 23, 2026
22766d4
review(blockhash-cache): guard ShouldPrune against sentinel overflow
LukaszRozmej Jun 23, 2026
dcea64a
review(state-composition): use bool flag to track previous snapshot
LukaszRozmej Jun 23, 2026
e26f126
review(evm): drop dead CalculateClaimableRefund virtual
LukaszRozmej Jun 23, 2026
d52de08
review(init): validate memoryHint covers GeneralMemory up front
LukaszRozmej Jun 23, 2026
69bbc79
review: drop dead >= 0 guards on ulong values
LukaszRozmej Jun 23, 2026
7accaed
review(consensus): make GasLimit <= 2^63-1 cap unconditional
LukaszRozmej Jun 23, 2026
49ab893
review(evm): restore BlockOverride GasLimit > long.MaxValue guard
LukaszRozmej Jun 23, 2026
c6b0104
review(state-flat): guard PersistenceManager depth underflow
LukaszRozmej Jun 23, 2026
f8a5b25
Merge remote-tracking branch 'origin/master' into pr-11937
LukaszRozmej Jun 23, 2026
d167a29
fix(test): cascade ulong cast & drop unused using
LukaszRozmej Jun 23, 2026
86edce8
ci: retrigger workflows
LukaszRozmej Jun 23, 2026
8ffc1b4
refactor(test/xdc): address pull request review feedback
Dyslex7c Jun 23, 2026
7eba810
Merge remote-tracking branch 'upstream/master' into unify-geth-types
Dyslex7c Jun 23, 2026
70921a4
fix(chainspec): parse hex transition keys with Convert.ToUInt64
LukaszRozmej Jun 24, 2026
009a783
review: address remaining ulong-cascade pitfalls
LukaszRozmej Jun 24, 2026
97fe32f
review: address remaining ulong-cascade findings from bot re-review
LukaszRozmej Jun 24, 2026
be6b9cb
Merge remote-tracking branch 'origin/master' into pr-11937-review
LukaszRozmej Jun 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 5 additions & 5 deletions src/Nethermind/Ethereum.Basic.Test/TransactionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private static TransactionTest Convert(TransactionTestJson testJson)
Data = Bytes.FromHexString(testJson.Data),
GasPrice = (UInt256)testJson.GasPrice,
PrivateKey = new PrivateKey(testJson.Key),
Nonce = (UInt256)testJson.Nonce,
Nonce = testJson.Nonce,
Signed = new Rlp(Bytes.FromHexString(testJson.Signed))
};
byte[] unsigned = Bytes.FromHexString(testJson.Unsigned);
Expand All @@ -92,9 +92,9 @@ private static TransactionTest Convert(TransactionTestJson testJson)
private class TransactionTestJson
{
public string Key { get; set; }
public long Nonce { get; set; }
public ulong Nonce { get; set; }
public long GasPrice { get; set; }
public long StartGas { get; set; }
public ulong StartGas { get; set; }
public string To { get; set; }
public long Value { get; set; }
public string Data { get; set; }
Expand All @@ -106,9 +106,9 @@ private class TransactionTestJson
public class TransactionTest
{
public PrivateKey PrivateKey { get; set; }
public UInt256 Nonce { get; set; }
public ulong Nonce { get; set; }
public UInt256 GasPrice { get; set; }
public long StartGas { get; set; }
public ulong StartGas { get; set; }
public Address To { get; set; }
public UInt256 Value { get; set; }
public byte[] Data { get; set; }
Expand Down
10 changes: 5 additions & 5 deletions src/Nethermind/Ethereum.Difficulty.Test/DifficultyTestJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ namespace Ethereum.Difficulty.Test
{
public class DifficultyTestJson
{
public int ParentTimestamp { get; set; }
public int ParentDifficulty { get; set; }
public int CurrentTimestamp { get; set; }
public int CurrentBlockNumber { get; set; }
public int CurrentDifficulty { get; set; }
public ulong ParentTimestamp { get; set; }
public ulong ParentDifficulty { get; set; }
public ulong CurrentTimestamp { get; set; }
public ulong CurrentBlockNumber { get; set; }
public ulong CurrentDifficulty { get; set; }
}
}
4 changes: 2 additions & 2 deletions src/Nethermind/Ethereum.Difficulty.Test/DifficultyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ public class DifficultyTests(
ulong parentTimestamp,
UInt256 parentDifficulty,
ulong currentTimestamp,
long currentBlockNumber,
ulong currentBlockNumber,
UInt256 currentDifficulty,
bool parentHasUncles)
{
public ulong ParentTimestamp { get; set; } = parentTimestamp;
public UInt256 ParentDifficulty { get; set; } = parentDifficulty;
public ulong CurrentTimestamp { get; set; } = currentTimestamp;
public long CurrentBlockNumber { get; set; } = currentBlockNumber;
public ulong CurrentBlockNumber { get; set; } = currentBlockNumber;
public bool ParentHasUncles { get; set; } = parentHasUncles;
public UInt256 CurrentDifficulty { get; set; } = currentDifficulty;
public string Name { get; set; } = name;
Expand Down
10 changes: 5 additions & 5 deletions src/Nethermind/Ethereum.Difficulty.Test/TestsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ private static IEnumerable<DifficultyTests> ExtractHexTests(string fileName, Dic
private static DifficultyTests ToTest(string fileName, string name, DifficultyTestJson json) =>
new(fileName,
name,
(ulong)json.ParentTimestamp,
(ulong)json.ParentDifficulty,
(ulong)json.CurrentTimestamp,
json.ParentTimestamp,
json.ParentDifficulty,
json.CurrentTimestamp,
json.CurrentBlockNumber,
(ulong)json.CurrentDifficulty,
json.CurrentDifficulty,
false);

private static UInt256 ToUInt256(string hex) => Bytes.FromHexString(hex.Replace("0x", "0")).ToUInt256();
Expand All @@ -71,7 +71,7 @@ private static DifficultyTests ToTest(string fileName, string name, DifficultyTe
(ulong)ToUInt256(json.ParentTimestamp),
ToUInt256(json.ParentDifficulty),
(ulong)ToUInt256(json.CurrentTimestamp),
(long)ToUInt256(json.CurrentBlockNumber),
(ulong)ToUInt256(json.CurrentBlockNumber),
ToUInt256(json.CurrentDifficulty),
HasUncles(json.ParentUncles));

Expand Down
2 changes: 1 addition & 1 deletion src/Nethermind/Ethereum.Test.Base/AccountState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class AccountState
{
public byte[] Code { get; set; } = [];
public UInt256 Balance { get; set; }
public UInt256 Nonce { get; set; }
public ulong Nonce { get; set; }
public Dictionary<UInt256, byte[]> Storage { get; set; } = [];
}
}
4 changes: 2 additions & 2 deletions src/Nethermind/Ethereum.Test.Base/GeneralStateTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public class GeneralStateTest : EthereumTest
public UInt256 CurrentDifficulty { get; set; }

public UInt256? CurrentBaseFee { get; set; }
public long CurrentGasLimit { get; set; }
public long CurrentNumber { get; set; }
public ulong CurrentGasLimit { get; set; }
public ulong CurrentNumber { get; set; }
public ulong CurrentTimestamp { get; set; }
public Hash256? PreviousHash { get; set; }
public Dictionary<Address, AccountState> Pre { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public class GeneralStateTestEnvJson
{
public Address CurrentCoinbase { get; set; }
public UInt256 CurrentDifficulty { get; set; }
public long CurrentGasLimit { get; set; }
public long CurrentNumber { get; set; }
public ulong CurrentGasLimit { get; set; }
public ulong CurrentNumber { get; set; }
public ulong CurrentTimestamp { get; set; }
public UInt256? CurrentBaseFee { get; set; }
public Hash256 PreviousHash { get; set; }
Expand Down
30 changes: 18 additions & 12 deletions src/Nethermind/Ethereum.Test.Base/JsonToEthereumTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,19 @@ namespace Ethereum.Test.Base
{
public static class JsonToEthereumTest
{
private static ulong ParseULong(string? hex) =>
Bytes.FromHexString(hex).ToULongFromBigEndianByteArrayWithoutLeadingZeros();

private static ulong? ParseULongNullable(string? hex) =>
hex is null ? null : (ulong?)Bytes.FromHexString(hex).ToULongFromBigEndianByteArrayWithoutLeadingZeros();

private static ForkActivation TransitionForkActivation(string transitionInfo)
{
const string timestampPrefix = "Time";
const char kSuffix = 'k';
if (!transitionInfo.StartsWith(timestampPrefix))
{
return new ForkActivation(int.Parse(transitionInfo));
return new ForkActivation(ulong.Parse(transitionInfo));
}

transitionInfo = transitionInfo.Remove(0, timestampPrefix.Length);
Expand All @@ -55,22 +61,22 @@ public static BlockHeader Convert(TestBlockHeaderJson? headerJson)
new Hash256(headerJson.UncleHash),
new Address(headerJson.Coinbase),
Bytes.FromHexString(headerJson.Difficulty).ToUInt256(),
(long)Bytes.FromHexString(headerJson.Number).ToUInt256(),
(long)Bytes.FromHexString(headerJson.GasLimit).ToUnsignedBigInteger(),
(ulong)Bytes.FromHexString(headerJson.Timestamp).ToUnsignedBigInteger(),
ParseULong(headerJson.Number),
ParseULong(headerJson.GasLimit),
ParseULong(headerJson.Timestamp),
Bytes.FromHexString(headerJson.ExtraData),
headerJson.BlobGasUsed is null ? null : (ulong)Bytes.FromHexString(headerJson.BlobGasUsed).ToUnsignedBigInteger(),
headerJson.ExcessBlobGas is null ? null : (ulong)Bytes.FromHexString(headerJson.ExcessBlobGas).ToUnsignedBigInteger(),
ParseULongNullable(headerJson.BlobGasUsed),
ParseULongNullable(headerJson.ExcessBlobGas),
headerJson.ParentBeaconBlockRoot is null ? null : new Hash256(headerJson.ParentBeaconBlockRoot),
headerJson.RequestsHash is null ? null : new Hash256(headerJson.RequestsHash),
headerJson.SlotNumber is null ? null : (ulong)Bytes.FromHexString(headerJson.SlotNumber).ToUnsignedBigInteger()
headerJson.SlotNumber is null ? null : ParseULong(headerJson.SlotNumber)
)
{
Bloom = new Bloom(Bytes.FromHexString(headerJson.Bloom)),
GasUsed = (long)Bytes.FromHexString(headerJson.GasUsed).ToUnsignedBigInteger(),
GasUsed = ParseULong(headerJson.GasUsed),
Hash = new Hash256(headerJson.Hash),
MixHash = new Hash256(headerJson.MixHash),
Nonce = (ulong)Bytes.FromHexString(headerJson.Nonce).ToUnsignedBigInteger(),
Nonce = ParseULong(headerJson.Nonce),
ReceiptsRoot = new Hash256(headerJson.ReceiptTrie),
StateRoot = new Hash256(headerJson.StateRoot),
TxRoot = new Hash256(headerJson.TransactionsTrie),
Expand All @@ -80,7 +86,7 @@ public static BlockHeader Convert(TestBlockHeaderJson? headerJson)

if (headerJson.BaseFeePerGas is not null)
{
header.BaseFeePerGas = (ulong)Bytes.FromHexString(headerJson.BaseFeePerGas).ToUnsignedBigInteger();
header.BaseFeePerGas = ParseULong(headerJson.BaseFeePerGas);
}

return header;
Expand Down Expand Up @@ -238,9 +244,9 @@ public static Transaction Convert(LegacyTransactionJson transactionJson)
Transaction transaction = new()
{
Value = transactionJson.Value,
GasLimit = transactionJson.GasLimit,
GasLimit = (ulong)transactionJson.GasLimit,
GasPrice = transactionJson.GasPrice,
Nonce = transactionJson.Nonce,
Nonce = (ulong)transactionJson.Nonce,
To = transactionJson.To,
Data = transactionJson.Data,
Signature = new Signature(transactionJson.R, transactionJson.S, transactionJson.V)
Expand Down
11 changes: 8 additions & 3 deletions src/Nethermind/Ethereum.Test.Base/TestBlockhashProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ namespace Ethereum.Test.Base
{
public class TestBlockhashProvider : IBlockhashProvider
{
public Hash256? GetBlockhash(BlockHeader currentBlock, long number, IReleaseSpec? spec)
public Hash256? GetBlockhash(BlockHeader currentBlock, ulong number, IReleaseSpec? spec)
{
long depth = currentBlock.Number - number;
if (depth <= 0 || depth > BlockhashProvider.MaxDepth)
if (number >= currentBlock.Number)
{
return null;
}

ulong depth = currentBlock.Number - number;
if (depth > BlockhashProvider.MaxDepth)
{
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Nethermind/Ethereum.Test.Base/TransactionJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ public class TransactionJson
public TxType Type { get; set; }
public Address Sender { get; set; }
public byte[][]? Data { get; set; }
public long[]? GasLimit { get; set; }
public ulong[]? GasLimit { get; set; }
public UInt256? GasPrice { get; set; }
public UInt256? MaxFeePerGas { get; set; }
public UInt256? MaxPriorityFeePerGas { get; set; }
public UInt256 Nonce { get; set; }
public ulong Nonce { get; set; }
public Address? To { get; set; }
public UInt256[]? Value { get; set; }
public byte[]? SecretKey { get; set; }
Expand Down
10 changes: 5 additions & 5 deletions src/Nethermind/Ethereum.Transaction.Test/TransactionJsonTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void Can_load_access_lists()
TransactionJson txJson = serializer.Deserialize<TransactionJson>(lists);
txJson.SecretKey = TestItem.PrivateKeyA.KeyBytes;
txJson.Value = new UInt256[1];
txJson.GasLimit = new long[1];
txJson.GasLimit = new ulong[1];
txJson.Data = new byte[1][];
Assert.That(txJson.AccessLists, Is.Not.Null);
Assert.That(txJson.AccessLists[0][0].Address, Is.EqualTo(new Address("0x0001020304050607080900010203040506070809")));
Expand Down Expand Up @@ -62,7 +62,7 @@ public void Amsterdam_state_test_without_env_slot_number_defaults_to_zero()
.WithChainId(1)
.WithGasPrice(0x10)
.WithGasLimit(0x100000)
.WithNonce(UInt256.Zero)
.WithNonce(0UL)
.To(contract)
.WithValue(0)
.SignedAndResolved(senderKey)
Expand Down Expand Up @@ -122,7 +122,7 @@ public void Invalid_pre_berlin_access_list_tx_with_empty_list_preserves_prestate
.WithAccessList(AccessList.Empty)
.WithGasLimit(100_000)
.WithGasPrice(10)
.WithNonce(UInt256.Zero)
.WithNonce(0UL)
.To(recipient)
.WithValue(0)
.SignedAndResolved(TestItem.PrivateKeyA)
Expand All @@ -146,14 +146,14 @@ public void Invalid_pre_berlin_access_list_tx_with_empty_list_preserves_prestate
{
[recipient] = new()
{
Nonce = UInt256.One,
Nonce = 1UL,
Balance = UInt256.Zero,
Code = [0x60, 0x01, 0x60, 0x00, 0x55], // PUSH1 1 PUSH1 0 SSTORE
Storage = new() { [UInt256.Zero] = new UInt256(0xdeadbeef).ToBigEndian() }
},
[sender] = new()
{
Nonce = UInt256.Zero,
Nonce = 0UL,
Balance = UInt256.Parse("1000000000000000000000"),
Code = [],
Storage = []
Expand Down
10 changes: 5 additions & 5 deletions src/Nethermind/Ethereum.Transaction.Test/TransactionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ private static TransactionTest CreateTest(string network, string name, Transacti
{
BlockNumber = Bytes.FromHexString(testJson.BlockNumber).ToUInt256(),
Data = Bytes.FromHexString(transactionJson.Data),
GasLimit = Bytes.FromHexString(transactionJson.GasLimit).ToUInt256(),
GasLimit = Bytes.FromHexString(transactionJson.GasLimit).ToULongFromBigEndianByteArrayWithoutLeadingZeros(),
GasPrice = Bytes.FromHexString(transactionJson.GasPrice).ToUInt256(),
Nonce = Bytes.FromHexString(transactionJson.Nonce).ToUInt256(),
Nonce = Bytes.FromHexString(transactionJson.Nonce).ToULongFromBigEndianByteArrayWithoutLeadingZeros(),
R = Bytes.FromHexString(transactionJson.R).ToUInt256(),
S = Bytes.FromHexString(transactionJson.S).ToUInt256(),
V = Bytes.FromHexString(transactionJson.V)[0],
Expand Down Expand Up @@ -99,7 +99,7 @@ private static void RunTest(TransactionTest test, IReleaseSpec spec)
{
Assert.That(transaction.Value, Is.EqualTo(validTest.Value), "value");
Assert.That(transaction.Data.AsArray(), Is.EqualTo(validTest.Data), "data");
Assert.That(transaction.GasLimit, Is.EqualTo(validTest.GasLimit.ToInt64(null)), "gasLimit");
Assert.That(transaction.GasLimit, Is.EqualTo(validTest.GasLimit), "gasLimit");
Assert.That(transaction.GasPrice, Is.EqualTo(validTest.GasPrice), "gasPrice");
Assert.That(transaction.Nonce, Is.EqualTo(validTest.Nonce), "nonce");
Assert.That(transaction.To, Is.EqualTo(validTest.To), "to");
Expand Down Expand Up @@ -154,9 +154,9 @@ public class ValidTransactionTest(string network, string name, string rlp)
{
public Address Sender { get; set; }
public UInt256 BlockNumber { get; set; }
public UInt256 Nonce { get; set; }
public ulong Nonce { get; set; }
public UInt256 GasPrice { get; set; }
public UInt256 GasLimit { get; set; }
public ulong GasLimit { get; set; }
public Address To { get; set; }
public UInt256 Value { get; set; }
public byte V { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions src/Nethermind/Nethermind.Api/IInitConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public interface IInitConfig : IConfig
string RpcDbUrl { get; set; }

[ConfigItem(Description = "The hint on the max memory limit, in bytes, to configure the database and networking memory allocations.", DefaultValue = "null")]
long? MemoryHint { get; set; }
ulong? MemoryHint { get; set; }

[ConfigItem(Description = "The maximum number of bad blocks observed on the network that will be stored on disk.", DefaultValue = "100")]
long? BadBlocksStored { get; set; }
Expand All @@ -85,7 +85,7 @@ public interface IInitConfig : IConfig
INodeStorage.KeyScheme StateDbKeyScheme { get; set; }

[ConfigItem(Description = "[TECHNICAL] Exit when block number is reached. Useful for scripting and testing.", DefaultValue = "null", HiddenFromDocs = true)]
long? ExitOnBlockNumber { get; set; }
ulong? ExitOnBlockNumber { get; set; }

[ConfigItem(Description = "[TECHNICAL] Exit when invalid block is triggered. Useful for scripting and testing.", DefaultValue = "null", HiddenFromDocs = true)]
bool ExitOnInvalidBlock { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions src/Nethermind/Nethermind.Api/InitConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public class InitConfig : IInitConfig
public DumpOptions AutoDump { get; set; } = DumpOptions.Default;

public string RpcDbUrl { get; set; } = string.Empty;
public long? MemoryHint { get; set; }
public ulong? MemoryHint { get; set; }
public long? BadBlocksStored { get; set; } = 100;
public bool DisableGcOnNewPayload { get; set; } = true;
public bool DisableMallocOpts { get; set; } = false;
public INodeStorage.KeyScheme StateDbKeyScheme { get; set; } = INodeStorage.KeyScheme.Current;
public long? ExitOnBlockNumber { get; set; } = null;
public ulong? ExitOnBlockNumber { get; set; } = null;
public bool ExitOnInvalidBlock { get; set; } = false;
public int BackgroundTaskConcurrency { get; set; } = 2;
public int BackgroundTaskMaxNumber { get; set; } = 2048;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void returns_correct_validator_type(AuRaParameters.ValidatorType validato
{
ValidatorType = validatorType,
Addresses = new[] { Address.Zero },
Validators = new Dictionary<long, AuRaParameters.Validator>()
Validators = new Dictionary<ulong, AuRaParameters.Validator>()
{
{
0, new AuRaParameters.Validator()
Expand Down
Loading
Loading