Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 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
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
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Api/IInitConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Api/InitConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class InitConfig : IInitConfig
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