Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Staging branch for devnet 4 #7607

Open
wants to merge 646 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
646 commits
Select commit Hold shift + click to select a range
aa0196b
Resolved conflicts
MarekM25 Sep 16, 2024
3e156c9
spec changes start
ak88 Aug 16, 2024
ceeee20
revert nonce increments
ak88 Aug 16, 2024
d4e3298
intrinsic gas
ak88 Aug 16, 2024
58da91d
cherry-picking
MarekM25 Sep 16, 2024
129f134
build fix
ak88 Aug 19, 2024
0237c49
fx unittest
ak88 Aug 20, 2024
2e8eddb
spec changes
ak88 Aug 22, 2024
da3e3bd
unit tests
ak88 Aug 22, 2024
7f7e2ee
Merge branch 'pectra' into feature/eip-7702
ak88 Aug 22, 2024
8badf7d
Build fix
ak88 Aug 22, 2024
3be0b1c
change nonce to ulong
ak88 Aug 22, 2024
ac4fd87
refactor ChargeAccountAccessGas
ak88 Aug 24, 2024
bdf56f9
gas fixes and bug
ak88 Aug 26, 2024
61d59f7
merge fix
ak88 Aug 27, 2024
b5cea7a
build fix
ak88 Aug 28, 2024
403207a
refactor txprocessor to using accessed addresses
ak88 Aug 29, 2024
bdc4dc0
fix
ak88 Sep 1, 2024
93159d2
encoder fix
ak88 Sep 2, 2024
bbc81a4
test strg
ak88 Sep 2, 2024
cb6ac2d
fix extcodehash
ak88 Sep 2, 2024
5301b89
7702 refunds
ak88 Sep 3, 2024
29257b2
Use uint256 for sig values
ak88 Sep 4, 2024
aef10ce
state test fix for auth list
ak88 Sep 4, 2024
9b9eb2e
validate auth sig in txvalidator
ak88 Sep 4, 2024
1053f7a
Revert "Use uint256 for sig values"
ak88 Sep 4, 2024
51856ad
unittest fixes
ak88 Sep 4, 2024
8335b61
unique check auth sig validity
ak88 Sep 4, 2024
d5b8037
test cleanup
ak88 Sep 4, 2024
e996c17
unittest fix
ak88 Sep 4, 2024
2ce9f73
do not allow empty auth list
ak88 Sep 5, 2024
2da8111
tx pool check if sender is delegation
ak88 Sep 5, 2024
22152a8
unittest for TxPool
ak88 Sep 6, 2024
904bdb6
modified hive.json for debugging
MarekM25 Sep 9, 2024
b6f2563
hive test cfg
ak88 Sep 9, 2024
6a77929
cleanup
ak88 Sep 9, 2024
2f1e85c
Auth list in RPC
ak88 Sep 9, 2024
d59d3fa
fix, disallow create tx in SetCode tx type
smartprogrammer93 Sep 10, 2024
189e566
fix chainid
ak88 Sep 12, 2024
0f388d1
revert temp path too long fix
ak88 Sep 12, 2024
c938923
small refactors
LukaszRozmej Sep 16, 2024
291ba9b
more basic refactors and cleanups
LukaszRozmej Sep 16, 2024
046fb36
Resolved conflicts
MarekM25 Sep 17, 2024
a0dbd21
Solving errors
MarekM25 Sep 17, 2024
7ec64d2
Builds error solved
MarekM25 Sep 17, 2024
7baea0b
Resolved conflicts
MarekM25 Sep 17, 2024
3e8726e
fix build errors
MarekM25 Sep 17, 2024
0db830c
cherry pick missing from 7702
ak88 Sep 17, 2024
b90b883
fix whitespaces
MarekM25 Sep 17, 2024
4532047
fix merge tests
MarekM25 Sep 17, 2024
93a7c75
cosmetic
MarekM25 Sep 17, 2024
a739b22
Null handling for requests
MarekM25 Sep 17, 2024
fa10981
tx decoder for setcode
ak88 Sep 17, 2024
7aa7aa8
RPC module tests for 7702
ak88 Sep 11, 2024
c9c1afc
cleanup after missing commit
ak88 Sep 17, 2024
5ac555e
tx validator for setcode refactor
ak88 Sep 18, 2024
7b5f627
fix tests
MarekM25 Sep 18, 2024
2953bca
cosmetic
MarekM25 Sep 18, 2024
f3c2c52
fix whitespace?
MarekM25 Sep 18, 2024
76b8b6f
whitespace?
MarekM25 Sep 18, 2024
540b86c
fix test
MarekM25 Sep 18, 2024
ce64d97
cosmetic
MarekM25 Sep 18, 2024
66bd24e
fix test
MarekM25 Sep 18, 2024
6465805
fix tx pool tests
ak88 Sep 18, 2024
958df8a
use BlockchainId instead
ak88 Sep 18, 2024
3f5e57b
unnecessary using
ak88 Sep 18, 2024
4c564b3
use BlockchainId instead
ak88 Sep 18, 2024
98d5277
Resolved conflicts with payload bodies
MarekM25 Sep 18, 2024
e39c754
Merge branch 'pectra_fix_7702_after_merge' of https://github.com/neth…
MarekM25 Sep 18, 2024
ff823b0
revert proof module
MarekM25 Sep 18, 2024
2653613
fix one more test
MarekM25 Sep 18, 2024
1857a61
fix whitespace
MarekM25 Sep 18, 2024
95fb7fa
whitespaces?
MarekM25 Sep 18, 2024
5c41d0a
fix whitespace
MarekM25 Sep 18, 2024
e8c1782
?fix
MarekM25 Sep 18, 2024
e8011ff
fix
MarekM25 Sep 18, 2024
28839a9
fix Evm.Test
MarekM25 Sep 18, 2024
63e262c
fix
MarekM25 Sep 18, 2024
2fac622
use SpecProvider.ChainId in test
ak88 Sep 18, 2024
6018e7d
Merge branch 'pectra_fix_7702_after_merge' of https://github.com/Neth…
ak88 Sep 18, 2024
d4b36c5
small refactor TransactionProcessorEip7702Tests
ak88 Sep 18, 2024
f3301ad
ignore authorization list if null TransactionForRpc
ak88 Sep 18, 2024
e7a91a2
fix SimulateReadOnlyBlocksProcessingEnv
ak88 Sep 18, 2024
51a63dd
fix EthModuleBenchmarks
ak88 Sep 18, 2024
ed6b5bf
remove unnecessary ?
LukaszRozmej Sep 19, 2024
a249a58
Move engine_getPayloadBodiesByHash to IHandler, no Async needed
LukaszRozmej Sep 19, 2024
b298026
syntatic suggar
LukaszRozmej Sep 19, 2024
638fd41
Merge branch 'master' into pectra_eips
MarekM25 Sep 19, 2024
a911023
Merge branch 'pectra_eips' into pectra_payload_bodies
MarekM25 Sep 19, 2024
bc5130b
Consensus requests change class structure
MarekM25 Sep 19, 2024
d29ca4d
one more field
MarekM25 Sep 19, 2024
1518f27
class to abstract
MarekM25 Sep 19, 2024
3acb335
Review fixes
MarekM25 Sep 19, 2024
650630e
Resolved conflicts
MarekM25 Sep 19, 2024
53043ad
extra test for refunds
ak88 Sep 19, 2024
d3197ec
some cosmetic changes
MarekM25 Sep 19, 2024
15040c9
Merge branch 'pectra_fix_7702_after_merge' of https://github.com/neth…
MarekM25 Sep 19, 2024
4e71d9a
Test null address
ak88 Sep 19, 2024
3361a63
remove unused
ak88 Sep 20, 2024
45bf7bd
enginemoduletest
ak88 Sep 20, 2024
28a0f7c
improve recoversignatures
ak88 Sep 20, 2024
026de88
Merge branch 'new_test' into pectra_fix_7702_after_merge
ak88 Sep 20, 2024
aec7e85
fix test
ak88 Sep 20, 2024
5e59935
if sender recovered from pool also set authority
ak88 Sep 20, 2024
54a59ba
Apply suggestions from code review
ak88 Sep 20, 2024
9c3ec4d
cosmetic
ak88 Sep 20, 2024
6d90306
Merge branch 'pectra_fix_7702_after_merge' of https://github.com/Neth…
ak88 Sep 20, 2024
7f48fd6
a few optimizations
MarekM25 Sep 20, 2024
552b704
Merge branch 'pectra_fix_7702_after_merge' of https://github.com/neth…
MarekM25 Sep 20, 2024
7da0be0
fix
MarekM25 Sep 20, 2024
18a3e0e
cosmetic
MarekM25 Sep 20, 2024
58ae212
cosmetic
MarekM25 Sep 23, 2024
c35e4ea
Resolved conflicts
MarekM25 Sep 23, 2024
581321d
cosmetic cleanup
ak88 Sep 23, 2024
43a99b2
cosmetic
ak88 Sep 24, 2024
757d06f
removed metric
ak88 Sep 24, 2024
1aa8096
cosmetic
MarekM25 Sep 25, 2024
65f06e2
Merge branch 'pectra_fix_7702_after_merge' of https://github.com/neth…
MarekM25 Sep 25, 2024
d124cf7
small optimization
ak88 Sep 25, 2024
f3bce87
small changes from review
ak88 Sep 25, 2024
0e23a9e
changes around CodeInfoRepository
LukaszRozmej Sep 26, 2024
e66c64c
Update src/Nethermind/Nethermind.Evm/CodeInfoRepository.cs
LukaszRozmej Sep 26, 2024
667e168
Update src/Nethermind/Nethermind.Evm/CodeInfoRepository.cs
LukaszRozmej Sep 26, 2024
42ab153
Update src/Nethermind/Nethermind.Consensus/Validators/TxValidator.cs
LukaszRozmej Sep 26, 2024
085fa42
Update src/Nethermind/Nethermind.Consensus/Validators/TxValidator.cs
LukaszRozmej Sep 26, 2024
a7dd3d9
Update src/Nethermind/Nethermind.Evm/VirtualMachine.cs
LukaszRozmej Sep 26, 2024
0b8062f
Update src/Nethermind/Nethermind.Facade/Eth/TransactionForRpc.cs
LukaszRozmej Sep 26, 2024
49105d2
Update src/Nethermind/Nethermind.State/IReadOnlyStateProviderExtensio…
LukaszRozmej Sep 26, 2024
110a5b8
fixes
LukaszRozmej Sep 26, 2024
c4b083d
avoid newing HashSet
ak88 Sep 26, 2024
1c69596
add NoContractCreationTxValidator, change SetCodeTxValidator to Autho…
LukaszRozmej Sep 26, 2024
8729021
Move code to value hashes
LukaszRozmej Sep 26, 2024
407effa
ReadConsolidationRequests reorder params to have consistency
LukaszRozmej Sep 26, 2024
a7035ce
simplify IntrinsicGasCalculator
LukaszRozmej Sep 26, 2024
d0dd643
simplify AccessListCost
LukaszRozmej Sep 26, 2024
295854f
grab TxExecutionContext by reference
LukaszRozmej Sep 26, 2024
c323bae
Invert VM condition for readability
LukaszRozmej Sep 26, 2024
900ac8b
Simplify RecoverAuthorityFilter
LukaszRozmej Sep 26, 2024
141c565
fix AuthorizationTupleDecoder
LukaszRozmej Sep 26, 2024
8607c8e
remove IRlpObjectDecoder<ConsolidationRequest>
LukaszRozmej Sep 26, 2024
b998979
bring back exceptions in IntrinsicGasCalculator
LukaszRozmej Sep 26, 2024
6a6db8b
fix
LukaszRozmej Sep 26, 2024
794f6da
fix
LukaszRozmej Sep 26, 2024
5f714d1
More CodeInfoRepository changes
LukaszRozmej Sep 26, 2024
fbc6822
More renames
LukaszRozmej Sep 26, 2024
cbde5c8
More refactors
LukaszRozmej Sep 26, 2024
2a9da1c
fixes
LukaszRozmej Sep 26, 2024
254ff42
changes from review
ak88 Sep 27, 2024
76129ad
decoder netty fix
ak88 Sep 27, 2024
70a3390
also check auth sig in recovery
ak88 Sep 27, 2024
ab855fb
move sign func to extension
ak88 Sep 28, 2024
e28f666
changes from review
ak88 Sep 30, 2024
2963ac2
fix tests
ak88 Oct 1, 2024
1be004e
refactor codeinforepo test
ak88 Oct 2, 2024
eeb4ff9
base class for processors
ak88 Sep 30, 2024
096fb43
Merge branch 'master' into pectra_fix_7702_after_merge
ak88 Oct 2, 2024
facba02
merge fix
ak88 Oct 2, 2024
60348e2
comment correction
ak88 Oct 2, 2024
e4c49d3
Merge branch 'master' into pectra_fix_7702_after_merge
ak88 Oct 2, 2024
86c9df2
format whitespace
ak88 Oct 2, 2024
cd151cc
benchmark fix
ak88 Oct 2, 2024
347a63a
small test change
ak88 Oct 2, 2024
0087008
Merge branch 'master' into pectra_fix_7702_after_merge
MarekM25 Oct 3, 2024
464deeb
Update src/Nethermind/Nethermind.Consensus/Processing/RecoverSignatur…
ak88 Oct 4, 2024
59a1ae2
Update src/Nethermind/Nethermind.Consensus/Processing/RecoverSignatur…
ak88 Oct 4, 2024
4b51139
Update src/Nethermind/Nethermind.Consensus/Processing/RecoverSignatur…
ak88 Oct 4, 2024
9f01cf2
review changes
ak88 Oct 4, 2024
0800ee3
use existing nulltxpool
ak88 Oct 4, 2024
7b51ea1
format
ak88 Oct 4, 2024
03db79c
cosmetic
ak88 Oct 4, 2024
86d8135
add flat encoding and requests as a side car
rjnrohit Oct 5, 2024
0d3aabe
Merge branch 'prague/devnet4' into flat_requests
rjnrohit Oct 5, 2024
28577ad
fix build error
rjnrohit Oct 5, 2024
f417572
fix more build error
rjnrohit Oct 5, 2024
ab9ca8e
more build errors
rjnrohit Oct 5, 2024
e085509
more build errors
rjnrohit Oct 5, 2024
aeba2a9
add requests to executionPayloadParams
rjnrohit Oct 5, 2024
db27172
ensure requests are in sorted order
rjnrohit Oct 5, 2024
8120251
add executionRequests processor tests
rjnrohit Oct 6, 2024
f97aa5a
make executionRequests optional
rjnrohit Oct 6, 2024
fafb812
fix test errors
rjnrohit Oct 7, 2024
26cb98e
format files
rjnrohit Oct 7, 2024
e2bfb69
remove Build.Deposit.cs
rjnrohit Oct 7, 2024
5bd226a
remove Build.WithdrawalRequest.cs
rjnrohit Oct 7, 2024
9ab33a1
requestsRoot -> requestsHash
rjnrohit Oct 7, 2024
23cba3c
remove test from block validator
rjnrohit Oct 7, 2024
47d94d4
remove undef ref
rjnrohit Oct 7, 2024
c92705d
fix cast error
rjnrohit Oct 7, 2024
5636cda
fix test build error
rjnrohit Oct 8, 2024
d2c0473
fix requests in Aura Test
rjnrohit Oct 8, 2024
f97a524
fix hash scheme
rjnrohit Oct 8, 2024
548ad77
Update root calculation
rjnrohit Oct 9, 2024
1c72a4e
move requestHash calc
rjnrohit Oct 9, 2024
b04c9f9
fix consensus test
rjnrohit Oct 9, 2024
465cbdf
fix ci tests
rjnrohit Oct 9, 2024
4e01f92
format files
rjnrohit Oct 9, 2024
c9cd867
remove signature changes
rjnrohit Oct 9, 2024
a87a144
optimise executionRequestProcessor
rjnrohit Oct 9, 2024
ac01e83
spec changes for 7702
ak88 Oct 10, 2024
41f86e3
Fix EXTCODEHASH for dead accounts
ak88 Oct 11, 2024
9b4267d
Merge branch 'master' into feature/7702-devnet-4
ak88 Oct 11, 2024
033dc7d
readd sig check after spec change
ak88 Oct 11, 2024
91e1c8f
fix test
ak88 Oct 11, 2024
54179bf
Change v in spec test
ak88 Oct 11, 2024
937ac55
Tuple decoder test for invalid field sizes
ak88 Oct 11, 2024
5bd0edf
address few comments
rjnrohit Oct 15, 2024
dc6dfec
Merge branch 'pectra_devnet_4' into prague/devnet4
rjnrohit Oct 15, 2024
0f29bbf
Merge branch 'prague/devnet4' into flat_requests
rjnrohit Oct 15, 2024
bb41884
fix address error
rjnrohit Oct 15, 2024
da380db
optimise alocations
rjnrohit Oct 15, 2024
226d904
optimize further
rjnrohit Oct 16, 2024
ad3698b
format files
rjnrohit Oct 16, 2024
76b3ff5
Add flat encoding and requests as a side car (#7608)
rjnrohit Oct 17, 2024
7a6885b
fix requestsHash calculation
rjnrohit Oct 17, 2024
a35445d
fix conflicts
rjnrohit Oct 17, 2024
59a2be2
fix test errors
rjnrohit Oct 17, 2024
15fe241
explicit prague tests
rjnrohit Oct 17, 2024
984bc07
format files
rjnrohit Oct 17, 2024
e854467
fix aura tests
rjnrohit Oct 17, 2024
215df80
format files
rjnrohit Oct 17, 2024
4a98a09
Merge branch 'master' into pectra_devnet_4
rjnrohit Oct 17, 2024
627207d
Merge branch 'pectra_devnet_4' into flat_requests
rjnrohit Oct 17, 2024
0c3dc33
7702 fix
ak88 Oct 17, 2024
855e354
Merge branch 'feature/7702-devnet-4' into pectra_devnet_4
MarekM25 Oct 17, 2024
58b5541
Merge branch 'master' into pectra_devnet_4
MarekM25 Oct 17, 2024
5eacd18
update addresses
MarekM25 Oct 17, 2024
d96af86
update executionRequestProcessor
rjnrohit Oct 17, 2024
141b961
Merge branch 'flat_requests' into pectra_devnet_4
rjnrohit Oct 17, 2024
70a5cce
format files
rjnrohit Oct 17, 2024
18b298c
fix hash calc
rjnrohit Oct 17, 2024
430f1b3
remove explicit
rjnrohit Oct 17, 2024
e3974bf
fixes for 7702
ak88 Oct 17, 2024
ca25cc8
revert test change
ak88 Oct 17, 2024
a8038c8
real fixes for tests + one missing TxValidator.cs fix
smartprogrammer93 Oct 17, 2024
1e410a3
revert load test strategy
ak88 Oct 17, 2024
5e3def2
format
ak88 Oct 17, 2024
c3827bc
fix test
ak88 Oct 17, 2024
0f9ce85
refactor sig check
ak88 Oct 22, 2024
dc660b4
Update src/Nethermind/Nethermind.Blockchain.Test/Validators/TxValidat…
ak88 Oct 23, 2024
df46327
fix chain spec loader
rjnrohit Oct 23, 2024
413917b
Merge branch 'master' into pectra_devnet_4
rjnrohit Oct 23, 2024
cffdcd2
address ak comments
rjnrohit Oct 23, 2024
35cdbb1
format files
rjnrohit Oct 23, 2024
480957a
make prague tests explicit
rjnrohit Oct 23, 2024
84e114c
Merge branch 'master' into pectra_devnet_4
rjnrohit Oct 24, 2024
3d2e6b7
add HeaderValidator tests
rjnrohit Oct 24, 2024
24ffe2f
Merge branch 'master' into pectra_devnet_4
rjnrohit Oct 24, 2024
1a6b6d9
fix invalid executionRequest error
rjnrohit Oct 24, 2024
49fb5cc
Merge branch 'master' into pectra_devnet_4
rjnrohit Oct 24, 2024
bfd37cf
remove wring testcases
rjnrohit Oct 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/Nethermind/Ethereum.Test.Base/AuthorizationListJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
// SPDX-License-Identifier: LGPL-3.0-only

using Nethermind.Core;
using Nethermind.Int256;

namespace Ethereum.Test.Base;
public class AuthorizationListJson
{
public ulong ChainId { get; set; }
public UInt256 ChainId { get; set; }
public Address Address { get; set; }
public ulong Nonce { get; set; }
public UInt256 Nonce { get; set; }
public ulong V { get; set; }
public byte[] R { get; set; }
public byte[] S { get; set; }
public string R { get; set; }
public string S { get; set; }
public Address Signer { get; set; }
}
2 changes: 1 addition & 1 deletion src/Nethermind/Ethereum.Test.Base/GeneralStateTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class GeneralStateTest : IEthereumTest
public UInt256? ParentBlobGasUsed { get; set; }
public UInt256? ParentExcessBlobGas { get; set; }

public Hash256? RequestsRoot { get; set; }
public Hash256? RequestsHash { get; set; }

public override string ToString()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Nethermind/Ethereum.Test.Base/GeneralTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ protected EthereumTestResult RunTest(GeneralStateTest test, ITxTracer txTracer)
header.ParentBeaconBlockRoot = test.CurrentBeaconRoot;
header.ExcessBlobGas = test.CurrentExcessBlobGas ?? (test.Fork is Cancun ? 0ul : null);
header.BlobGasUsed = BlobGasCalculator.CalculateBlobGas(test.Transaction);
header.RequestsRoot = test.RequestsRoot;
header.RequestsHash = test.RequestsHash;

Stopwatch stopwatch = Stopwatch.StartNew();
IReleaseSpec? spec = specProvider.GetSpec((ForkActivation)test.CurrentNumber);
Expand Down
52 changes: 45 additions & 7 deletions src/Nethermind/Ethereum.Test.Base/JsonToEthereumTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,51 @@ public static Transaction Convert(PostStateJson postStateJson, TransactionJson t
{
transaction.AuthorizationList =
transactionJson.AuthorizationList
.Select(i => new AuthorizationTuple(
i.ChainId,
i.Address,
i.Nonce,
i.V,
i.R,
i.S)).ToArray();
.Select(i =>
{
if (i.ChainId > ulong.MaxValue)
{
i.ChainId = 0;
transaction.SenderAddress = Address.Zero;
}
if (i.Nonce > ulong.MaxValue)
{
i.Nonce = 0;
transaction.SenderAddress = Address.Zero;
}
UInt256 s = UInt256.Zero;
if (i.S.Length > 66)
{
i.S = "0x0";
transaction.SenderAddress = Address.Zero;
}
else
{
s = UInt256.Parse(i.S);
}
UInt256 r = UInt256.Zero;
if (i.R.Length > 66)
{
i.R = "0x0";
transaction.SenderAddress = Address.Zero;
}
else
{
r = UInt256.Parse(i.R);
}
if (i.V > byte.MaxValue)
{
i.V = 0;
transaction.SenderAddress = Address.Zero;
}
return new AuthorizationTuple(
i.ChainId.u0,
i.Address,
i.Nonce.u0,
(byte)i.V,
r,
s);
}).ToArray();
if (transaction.AuthorizationList.Any())
{
transaction.Type = TxType.SetCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// SPDX-License-Identifier: LGPL-3.0-only

using Nethermind.Consensus.Validators;
using Nethermind.Core.ConsensusRequests;
using Nethermind.Core;
using Nethermind.Core.Crypto;
using Nethermind.Core.Specs;
Expand Down Expand Up @@ -196,54 +195,6 @@ public void ValidateSuggestedBlock_SuggestedBlockIsInvalid_CorrectErrorIsSet(Blo

sut.ValidateSuggestedBlock(
suggestedBlock, out error);

Assert.That(error, Does.StartWith(expectedError));
}

[Test]
public void ValidateBodyAgainstHeader_BlockHasInvalidRequestRoot_ReturnsFalse()
rjnrohit marked this conversation as resolved.
Show resolved Hide resolved
{
Block block = Build.A.Block
.WithConsensusRequests(new ConsensusRequest[] {
Build.A.Deposit.WithIndex(0).TestObject,
Build.A.WithdrawalRequest.TestObject
})
.TestObject;
block.Header.RequestsRoot = Keccak.OfAnEmptyString;

Assert.That(
BlockValidator.ValidateBodyAgainstHeader(block.Header, block.Body),
Is.False);
}

[Test]
public void ValidateBodyRequests_BlockHasReuests_InOrder_ReturnsTrue()
{
Block block = Build.A.Block
.WithConsensusRequests(new ConsensusRequest[] {
Build.A.Deposit.WithIndex(0).TestObject,
Build.A.WithdrawalRequest.TestObject
})
.TestObject;

Assert.That(
BlockValidator.ValidateRequestsOrder(block, out string? _),
Is.True);
}

[Test]
public void ValidateBodyRequests_BlockHasReuests_OutOfOrder_ReturnsFalse()
{
Block block = Build.A.Block
.WithConsensusRequests(new ConsensusRequest[] {
Build.A.WithdrawalRequest.TestObject,
Build.A.Deposit.WithIndex(0).TestObject
})
.TestObject;

Assert.That(
BlockValidator.ValidateRequestsOrder(block, out string? _),
Is.False);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ public void IsWellFormed_CreateTxInSetCode_ReturnsFalse()
{
TransactionBuilder<Transaction> txBuilder = Build.A.Transaction
.WithType(TxType.SetCode)
.WithAuthorizationCode(new AuthorizationTuple(0, TestItem.AddressA, 0, 0, [], []))
.WithAuthorizationCode(new AuthorizationTuple(0, TestItem.AddressA, 0, 0, 0, 0))
.WithMaxFeePerGas(100000)
.WithGasLimit(1000000)
.WithChainId(TestBlockchainIds.ChainId)
Expand All @@ -552,7 +552,7 @@ public void IsWellFormed_AuthorizationListTxInPragueSpec_ReturnsTrue()
TransactionBuilder<Transaction> txBuilder = Build.A.Transaction
.WithType(TxType.SetCode)
.WithTo(TestItem.AddressA)
.WithAuthorizationCode(new AuthorizationTuple(0, TestItem.AddressA, 0, 0, [], []))
.WithAuthorizationCode(new AuthorizationTuple(0, TestItem.AddressA, 0, 0, 0, 0))
.WithMaxFeePerGas(100000)
.WithGasLimit(1000000)
.WithChainId(TestBlockchainIds.ChainId)
Expand Down Expand Up @@ -599,30 +599,6 @@ public void IsWellFormed_NullAuthorizationList_ReturnsFalse()
Assert.That(txValidator.IsWellFormed(tx, Prague.Instance).AsBool, Is.False);
}

private static object[] BadSignatures =
{
new object[] { 1ul, (UInt256)1, Secp256K1Curve.HalfNPlusOne, false},
new object[] { 1ul, UInt256.Zero, Secp256K1Curve.HalfN, true },
new object[] { 0ul, UInt256.Zero, UInt256.Zero, true },
};
[TestCaseSource(nameof(BadSignatures))]
public void IsWellFormed_AuthorizationTupleHasBadSignature_ReturnsFalse(ulong yParity, UInt256 r, UInt256 s, bool expected)
{
TransactionBuilder<Transaction> txBuilder = Build.A.Transaction
.WithType(TxType.SetCode)
.WithTo(TestItem.AddressA)
.WithAuthorizationCode(new AuthorizationTuple(0, Address.Zero, 0, new Signature(r, s, yParity + Signature.VOffset)))
.WithMaxFeePerGas(100000)
.WithGasLimit(1000000)
.WithChainId(TestBlockchainIds.ChainId)
.SignedAndResolved();

Transaction tx = txBuilder.TestObject;
TxValidator txValidator = new(TestBlockchainIds.ChainId);

Assert.That(txValidator.IsWellFormed(tx, Prague.Instance).AsBool, Is.EqualTo(expected));
}

private static IEnumerable<TxType> NonSetCodeTypes() =>
Enum.GetValues<TxType>().Where(t => t != TxType.SetCode && t != TxType.DepositTx);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
using Nethermind.Blockchain.Find;
using Nethermind.Blockchain.Receipts;
using Nethermind.Consensus.AuRa.Validators;
using Nethermind.Consensus.ExecutionRequests;
using Nethermind.Consensus.Processing;
using Nethermind.Consensus.Requests;
using Nethermind.Consensus.Rewards;
using Nethermind.Consensus.Transactions;
using Nethermind.Consensus.Validators;
Expand Down Expand Up @@ -51,7 +51,7 @@ public AuRaBlockProcessor(
AuRaContractGasLimitOverride? gasLimitOverride = null,
ContractRewriter? contractRewriter = null,
IBlockCachePreWarmer? preWarmer = null,
IConsensusRequestsProcessor? consensusRequestsProcessor = null)
IExecutionRequestsProcessor? executionRequestsProcessor = null)
: base(
specProvider,
blockValidator,
Expand All @@ -65,7 +65,7 @@ public AuRaBlockProcessor(
logManager,
withdrawalProcessor,
preWarmer: preWarmer,
consensusRequestsProcessor: consensusRequestsProcessor)
executionRequestsProcessor: executionRequestsProcessor)
{
_specProvider = specProvider;
_blockTree = blockTree ?? throw new ArgumentNullException(nameof(blockTree));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
using Nethermind.Consensus.Producers;
using Nethermind.Consensus.Transactions;
using Nethermind.Core;
using Nethermind.Core.ConsensusRequests;
using Nethermind.Core.Crypto;
using Nethermind.Core.Specs;
using Nethermind.Crypto;
Expand Down Expand Up @@ -500,8 +499,7 @@ ILogManager logManager
header,
selectedTxs,
Array.Empty<BlockHeader>(),
spec.WithdrawalsEnabled ? Enumerable.Empty<Withdrawal>() : null,
spec.RequestsEnabled ? Enumerable.Empty<ConsensusRequest>() : null
spec.WithdrawalsEnabled ? Enumerable.Empty<Withdrawal>() : null
);
header.TxRoot = TxTrie.CalculateRoot(block.Transactions);
block.Header.Author = _sealer.Address;
Expand Down
70 changes: 0 additions & 70 deletions src/Nethermind/Nethermind.Consensus.Test/DepositProcessorTests.cs

This file was deleted.

Loading
Loading