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

EIP 7742 implementation #7518

Open
wants to merge 46 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
de19765
Get target_blob_count, max_blob_count from Engine Api
yerke26 Sep 30, 2024
eca6690
fix HeaderDecoder, restore Eip4844 changes, Add Eip7742
yerke26 Oct 1, 2024
7ac90df
Merge branch 'master' into feature/eip-7742
yerke26 Oct 1, 2024
9be8a53
fix HeaderDecoder
yerke26 Oct 1, 2024
c592412
move new params from ExecutionPayload to ExecutionPayloadV4
yerke26 Oct 1, 2024
f6ae01c
revert minor changes
yerke26 Oct 1, 2024
f803097
added new params to PayloadAttributes
yerke26 Oct 1, 2024
7043124
fix tests
yerke26 Oct 1, 2024
fef9cb2
fix whitespaces
yerke26 Oct 1, 2024
cc02ce5
add tests
yerke26 Oct 2, 2024
206d514
Merge branch 'master' into feature/eip-7742
yerke26 Oct 2, 2024
9fbb9c1
add missing fields
yerke26 Oct 4, 2024
8ada4e2
fix PayloadAttributes
yerke26 Oct 7, 2024
3ae0fed
add engine_forkchoiceUpdatedV4 to EngineRpcModule.Prague
yerke26 Oct 7, 2024
372868a
change to engine_forkchoiceUpdatedV4
yerke26 Oct 7, 2024
0bd75c6
Merge branch 'master' into feature/eip-7742
yerke26 Oct 7, 2024
4b5fbfc
add new fields to EngineModuleTests.V4
yerke26 Oct 7, 2024
5078b76
added new engine_forkchoiceUpdatedV4 to EngineRpcCapabilitiesProvider
yerke26 Oct 7, 2024
a92cdde
fix test cases
yerke26 Oct 8, 2024
c032480
Merge branch 'master' into feature/eip-7742
yerke26 Oct 8, 2024
4ab5fda
fix whitespace
yerke26 Oct 8, 2024
0ba2006
fix EngineRpcCapabilitiesProvider, revert ChainSpecBasedSpecProviderT…
yerke26 Oct 8, 2024
911d232
remove unnecessary comment
yerke26 Oct 8, 2024
f806f22
remove comments
yerke26 Oct 8, 2024
8dc3d6a
Merge branch 'master' into feature/eip-7742
yerke26 Oct 15, 2024
a993d59
Merge branch 'master' into feature/eip-7742
yerke26 Oct 30, 2024
ba1a3de
Merge branch 'master' into feature/eip-7742
yerke26 Nov 4, 2024
87e721a
add eip7742 logic to TryCalculateFeePerBlobGas
yerke26 Nov 4, 2024
e52fc98
remove MaxBlobCount, pass Spec to BlobGasCalculator
yerke26 Nov 4, 2024
49424d9
Merge branch 'master' into feature/eip-7742
yerke26 Nov 4, 2024
2162240
resolve merge conflicts
yerke26 Nov 4, 2024
9d4ec74
add MaxBlobCount in PayloadAttributes, refactoring, resolve comments
yerke26 Nov 5, 2024
d8e088c
fix tests
yerke26 Nov 5, 2024
793d085
Merge branch 'master' into feature/eip-7742
yerke26 Nov 5, 2024
a4fd1ef
fix Evm tool
yerke26 Nov 5, 2024
d022c4f
fix Evm tool
yerke26 Nov 5, 2024
47437f2
Merge branch 'master' into feature/eip-7742
yerke26 Nov 25, 2024
020ceef
resolve merge conflicts
yerke26 Nov 25, 2024
5699ad4
fix some tests
yerke26 Nov 26, 2024
81fb376
Merge branch 'master' into feature/eip-7742
yerke26 Nov 26, 2024
332322d
fix tests
yerke26 Nov 27, 2024
91822aa
fix AuraTests
yerke26 Nov 28, 2024
b4790dd
fix tests
yerke26 Nov 28, 2024
36464ad
fix JsonRpcTests
yerke26 Nov 28, 2024
459ebb7
fix TraceRpcModuleTests
yerke26 Nov 28, 2024
71963b7
fix tests
yerke26 Nov 28, 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
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 @@ -129,14 +129,14 @@
BlobGasUsed = (ulong)test.ParentBlobGasUsed,
ExcessBlobGas = (ulong)test.ParentExcessBlobGas,
};
header.ExcessBlobGas = BlobGasCalculator.CalculateExcessBlobGas(parent, spec);
header.ExcessBlobGas = BlobGasCalculator.CalculateExcessBlobGas(parent, spec, header);
}

ValidationResult txIsValid = _txValidator.IsWellFormed(test.Transaction, spec);

if (txIsValid)
{
transactionProcessor.Execute(test.Transaction, new BlockExecutionContext(header), txTracer);

Check failure on line 139 in src/Nethermind/Ethereum.Test.Base/GeneralTestBase.cs

View workflow job for this annotation

GitHub Actions / Build (debug, Benchmarks)

'BlockExecutionContext' does not contain a constructor that takes 1 arguments

Check failure on line 139 in src/Nethermind/Ethereum.Test.Base/GeneralTestBase.cs

View workflow job for this annotation

GitHub Actions / Build (debug, Benchmarks)

'BlockExecutionContext' does not contain a constructor that takes 1 arguments

Check failure on line 139 in src/Nethermind/Ethereum.Test.Base/GeneralTestBase.cs

View workflow job for this annotation

GitHub Actions / Build (release, Evm/Evm.sln)

'BlockExecutionContext' does not contain a constructor that takes 1 arguments

Check failure on line 139 in src/Nethermind/Ethereum.Test.Base/GeneralTestBase.cs

View workflow job for this annotation

GitHub Actions / Build (release, Evm/Evm.sln)

'BlockExecutionContext' does not contain a constructor that takes 1 arguments

Check failure on line 139 in src/Nethermind/Ethereum.Test.Base/GeneralTestBase.cs

View workflow job for this annotation

GitHub Actions / Build (debug, EthereumTests)

'BlockExecutionContext' does not contain a constructor that takes 1 arguments

Check failure on line 139 in src/Nethermind/Ethereum.Test.Base/GeneralTestBase.cs

View workflow job for this annotation

GitHub Actions / Build (debug, EthereumTests)

'BlockExecutionContext' does not contain a constructor that takes 1 arguments

Check failure on line 139 in src/Nethermind/Ethereum.Test.Base/GeneralTestBase.cs

View workflow job for this annotation

GitHub Actions / Build (release, Benchmarks)

'BlockExecutionContext' does not contain a constructor that takes 1 arguments

Check failure on line 139 in src/Nethermind/Ethereum.Test.Base/GeneralTestBase.cs

View workflow job for this annotation

GitHub Actions / Build (release, Benchmarks)

'BlockExecutionContext' does not contain a constructor that takes 1 arguments
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ protected override TxPoolTxSource CreateTxPoolTxSource()
TxPoolTxSource txPoolTxSource = base.CreateTxPoolTxSource();

TxPriorityContract = new TxPriorityContract(AbiEncoder.Instance, TestItem.AddressA,
new ReadOnlyTxProcessingEnv(WorldStateManager, BlockTree.AsReadOnly(), SpecProvider, LimboLogs.Instance));
new ReadOnlyTxProcessingEnv(WorldStateManager, BlockTree.AsReadOnly(), SpecProvider, LimboLogs.Instance), SpecProvider);

Priorities = new DictionaryContractDataStore<TxPriorityContract.Destination>(
new TxPriorityContract.DestinationSortedListContractDataStoreCollection(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ public TestEip4844Config(ulong? maxBlobGasPerBlock = null)

public ulong GasPerBlob => Eip4844Constants.GasPerBlob;

public int GetMaxBlobsPerBlock() => (int)(MaxBlobGasPerBlock / GasPerBlob);
public ulong GetMaxBlobsPerBlock() => MaxBlobGasPerBlock / GasPerBlob;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Nethermind.Core.Eip2930;
using Nethermind.Core.Specs;
using Nethermind.Crypto;
using Nethermind.Evm;
using Nethermind.Evm.Tracing;
using Nethermind.Evm.TransactionProcessing;
using Nethermind.Int256;
Expand Down Expand Up @@ -62,7 +63,7 @@ public void StoreBeaconRoot(Block block, IReleaseSpec spec, ITxTracer tracer)

transaction.Hash = transaction.CalculateHash();

processor.Execute(transaction, header, tracer);
processor.Execute(transaction, new BlockExecutionContext(header, spec), tracer);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private void OnHeadChanged(object? sender, BlockReplacementEventArgs e)
BlockGasLimit = e.Block!.GasLimit;
CurrentBaseFee = e.Block.Header.BaseFeePerGas;
CurrentFeePerBlobGas =
BlobGasCalculator.TryCalculateFeePerBlobGas(e.Block.Header, out UInt256 currentFeePerBlobGas)
BlobGasCalculator.TryCalculateFeePerBlobGas(e.Block.Header, out UInt256 currentFeePerBlobGas, SpecProvider)
? currentFeePerBlobGas
: UInt256.Zero;
HeadChanged?.Invoke(sender, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using Nethermind.Abi;
using Nethermind.Core;
using Nethermind.Core.Specs;
using Nethermind.Int256;
using Nethermind.Evm;
using Nethermind.Evm.Tracing;
Expand All @@ -24,7 +25,8 @@ public abstract class CallableContract : Contract
/// <param name="transactionProcessor">Transaction processor on which all <see cref="Call(Nethermind.Core.BlockHeader,Nethermind.Core.Transaction)"/> should be run on.</param>
/// <param name="abiEncoder">Binary interface encoder/decoder.</param>
/// <param name="contractAddress">Address where contract is deployed.</param>
protected CallableContract(ITransactionProcessor transactionProcessor, IAbiEncoder abiEncoder, Address contractAddress) : base(abiEncoder, contractAddress)
/// <param name="specProvider">Address where contract is deployed.</param>
protected CallableContract(ITransactionProcessor transactionProcessor, IAbiEncoder abiEncoder, Address contractAddress, ISpecProvider specProvider) : base(specProvider, abiEncoder, contractAddress)
{
_transactionProcessor = transactionProcessor ?? throw new ArgumentNullException(nameof(transactionProcessor));
}
Expand Down Expand Up @@ -66,7 +68,7 @@ private bool TryCall(BlockHeader header, Transaction transaction, out byte[] res

try
{
_transactionProcessor.Execute(transaction, new BlockExecutionContext(header), tracer);
_transactionProcessor.Execute(transaction, new BlockExecutionContext(header, SpecProvider), tracer);
result = tracer.ReturnValue;
return tracer.StatusCode == StatusCode.Success;
}
Expand All @@ -87,7 +89,7 @@ private bool TryCall(BlockHeader header, Transaction transaction, out byte[] res
/// <param name="arguments">Arguments to the function.</param>
/// <returns>true if function was <see cref="StatusCode.Success"/> otherwise false.</returns>
protected bool TryCall(BlockHeader header, string functionName, Address sender, out object[] result, params object[] arguments) =>
TryCall(header, functionName, sender, DefaultContractGasLimit, out result, arguments);
TryCall(header, functionName, sender, DefaultContractGasLimit, out result);

/// <summary>
/// Same as <see cref="Call(Nethermind.Core.BlockHeader,AbiFunctionDescription,Address,object[])"/> but returns false instead of throwing <see cref="AbiException"/>.
Expand Down
10 changes: 7 additions & 3 deletions src/Nethermind/Nethermind.Blockchain/Contracts/Contract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Nethermind.Blockchain.Contracts.Json;
using Nethermind.Core;
using Nethermind.Core.Crypto;
using Nethermind.Core.Specs;
using Nethermind.Crypto;
using Nethermind.Int256;
using Nethermind.Evm;
Expand Down Expand Up @@ -36,18 +37,21 @@ public abstract partial class Contract
protected IAbiEncoder AbiEncoder { get; }
public AbiDefinition AbiDefinition { get; }
public Address? ContractAddress { get; protected set; }
protected ISpecProvider SpecProvider { get; set; }

/// <summary>
/// Creates contract
/// </summary>
/// <param name="specProvider">Binary interface encoder/decoder.</param>
/// <param name="abiEncoder">Binary interface encoder/decoder.</param>
/// <param name="contractAddress">Address where contract is deployed.</param>
/// <param name="abiDefinition">Binary definition of contract.</param>
protected Contract(IAbiEncoder? abiEncoder = null, Address? contractAddress = null, AbiDefinition? abiDefinition = null)
protected Contract(ISpecProvider specProvider, IAbiEncoder? abiEncoder = null, Address? contractAddress = null, AbiDefinition? abiDefinition = null)
{
AbiEncoder = abiEncoder ?? Abi.AbiEncoder.Instance;
ContractAddress = contractAddress;
AbiDefinition = abiDefinition ?? new AbiDefinitionParser().Parse(GetType());
SpecProvider = specProvider;
}

protected virtual Transaction GenerateTransaction<T>(Address? contractAddress, byte[] transactionData, Address sender, long gasLimit = DefaultContractGasLimit, BlockHeader header = null)
Expand Down Expand Up @@ -178,11 +182,11 @@ protected byte[] CallCore(ITransactionProcessor transactionProcessor, BlockHeade
{
if (callAndRestore)
{
transactionProcessor.CallAndRestore(transaction, new BlockExecutionContext(header), tracer);
transactionProcessor.CallAndRestore(transaction, new BlockExecutionContext(header, SpecProvider), tracer);
}
else
{
transactionProcessor.Execute(transaction, new BlockExecutionContext(header), tracer);
transactionProcessor.Execute(transaction, new BlockExecutionContext(header, SpecProvider), tracer);
}

failure = tracer.StatusCode != StatusCode.Success;
Expand Down
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Blockchain/GenesisLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private void Preallocate(Block genesis)
};

CallOutputTracer outputTracer = new();
_transactionProcessor.Execute(constructorTransaction, new BlockExecutionContext(genesis.Header), outputTracer);
_transactionProcessor.Execute(constructorTransaction, new BlockExecutionContext(genesis.Header, _specProvider), outputTracer);

if (outputTracer.StatusCode != StatusCode.Success)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public AuRaValidatorFactory(IAbiEncoder abiEncoder,

public IAuRaValidator CreateValidatorProcessor(AuRaParameters.Validator validator, BlockHeader parentHeader = null, long? startBlock = null)
{
IValidatorContract GetValidatorContract() => new ValidatorContract(_transactionProcessor, _abiEncoder, validator.GetContractAddress(), _stateProvider, _readOnlyTxProcessorSource, _signer);
IReportingValidatorContract GetReportingValidatorContract() => new ReportingValidatorContract(_abiEncoder, validator.GetContractAddress(), _signer);
IValidatorContract GetValidatorContract() => new ValidatorContract(_transactionProcessor, _abiEncoder, validator.GetContractAddress(), _stateProvider, _readOnlyTxProcessorSource, _signer, _specProvider);
IReportingValidatorContract GetReportingValidatorContract() => new ReportingValidatorContract(_abiEncoder, validator.GetContractAddress(), _signer, _specProvider);

var validSealerStrategy = new ValidSealerStrategy();
long startBlockNumber = startBlock ?? AuRaValidatorBase.DefaultStartBlockNumber;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Nethermind.Abi;
using Nethermind.Blockchain.Contracts;
using Nethermind.Core;
using Nethermind.Core.Specs;
using Nethermind.Int256;
using Nethermind.Evm.TransactionProcessing;

Expand All @@ -24,8 +25,9 @@ public BlockGasLimitContract(
IAbiEncoder abiEncoder,
Address contractAddress,
long transitionBlock,
IReadOnlyTxProcessorSource readOnlyTxProcessorSource)
: base(abiEncoder, contractAddress ?? throw new ArgumentNullException(nameof(contractAddress)))
IReadOnlyTxProcessorSource readOnlyTxProcessorSource,
ISpecProvider specProvider)
: base(specProvider, abiEncoder, contractAddress ?? throw new ArgumentNullException(nameof(contractAddress)))
{
Activation = transitionBlock;
Constant = GetConstant(readOnlyTxProcessorSource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using Nethermind.Abi;
using Nethermind.Core;
using Nethermind.Core.Specs;
using Nethermind.Evm.TransactionProcessing;

namespace Nethermind.Consensus.AuRa.Contracts
Expand All @@ -22,8 +23,9 @@ public class CertifierContract : RegisterBasedContract, ICertifierContract
public CertifierContract(
IAbiEncoder abiEncoder,
IRegisterContract registerContract,
IReadOnlyTxProcessorSource readOnlyTransactionProcessorSource)
: base(abiEncoder, registerContract, ServiceTransactionContractRegistryName)
IReadOnlyTxProcessorSource readOnlyTransactionProcessorSource,
ISpecProvider specProvider)
: base(abiEncoder, registerContract, ServiceTransactionContractRegistryName, specProvider)
{
Constant = GetConstant(readOnlyTransactionProcessorSource);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Nethermind.Abi;
using Nethermind.Core;
using Nethermind.Core.Crypto;
using Nethermind.Core.Specs;
using Nethermind.Int256;
using Nethermind.Evm.TransactionProcessing;

Expand Down Expand Up @@ -81,8 +82,9 @@ public RandomContract(
Address contractAddress,
IReadOnlyTxProcessorSource readOnlyTxProcessorSource,
long transitionBlock,
ISigner signer)
: base(abiEncoder, contractAddress ?? throw new ArgumentNullException(nameof(contractAddress)))
ISigner signer,
ISpecProvider specProvider)
: base(specProvider, abiEncoder, contractAddress ?? throw new ArgumentNullException(nameof(contractAddress)))
{
_signer = signer;
Activation = transitionBlock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Nethermind.Blockchain.Contracts;
using Nethermind.Core;
using Nethermind.Core.Crypto;
using Nethermind.Core.Specs;

namespace Nethermind.Consensus.AuRa.Contracts
{
Expand All @@ -18,8 +19,9 @@ public RegisterBasedContract(
IAbiEncoder abiEncoder,
IRegisterContract registerContract,
string registryKey,
ISpecProvider specProvider,
AbiDefinition? abiDefinition = null)
: base(abiEncoder, abiDefinition: abiDefinition)
: base(specProvider, abiEncoder, abiDefinition: abiDefinition)
{
_registerContract = registerContract;
_registryKey = registryKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Nethermind.Blockchain.Contracts;
using Nethermind.Core;
using Nethermind.Core.Crypto;
using Nethermind.Core.Specs;
using Nethermind.Evm.TransactionProcessing;

namespace Nethermind.Consensus.AuRa.Contracts
Expand Down Expand Up @@ -33,8 +34,9 @@ public class RegisterContract : Contract, IRegisterContract
public RegisterContract(
IAbiEncoder abiEncoder,
Address contractAddress,
IReadOnlyTxProcessorSource readOnlyTxProcessorSource)
: base(abiEncoder, contractAddress ?? throw new ArgumentNullException(nameof(contractAddress)))
IReadOnlyTxProcessorSource readOnlyTxProcessorSource,
ISpecProvider specProvider)
: base(specProvider, abiEncoder, contractAddress ?? throw new ArgumentNullException(nameof(contractAddress)))
{
Constant = GetConstant(readOnlyTxProcessorSource);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Nethermind.Abi;
using Nethermind.Blockchain.Contracts;
using Nethermind.Core;
using Nethermind.Core.Specs;
using Nethermind.Int256;

namespace Nethermind.Consensus.AuRa.Contracts
Expand Down Expand Up @@ -47,8 +48,9 @@ public sealed class ReportingValidatorContract : Contract, IReportingValidatorCo
public ReportingValidatorContract(
IAbiEncoder abiEncoder,
Address contractAddress,
ISigner signer)
: base(abiEncoder, contractAddress ?? throw new ArgumentNullException(nameof(contractAddress)))
ISigner signer,
ISpecProvider specProvider)
: base(specProvider, abiEncoder, contractAddress ?? throw new ArgumentNullException(nameof(contractAddress)))
{
_signer = signer ?? throw new ArgumentNullException(nameof(signer));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Nethermind.Abi;
using Nethermind.Blockchain.Contracts;
using Nethermind.Core;
using Nethermind.Core.Specs;
using Nethermind.Int256;
using Nethermind.Evm.TransactionProcessing;

Expand Down Expand Up @@ -34,8 +35,8 @@ public sealed class RewardContract : CallableContract, IRewardContract
{
public long Activation { get; }

public RewardContract(ITransactionProcessor transactionProcessor, IAbiEncoder abiEncoder, Address contractAddress, long transitionBlock)
: base(transactionProcessor, abiEncoder, contractAddress ?? throw new ArgumentNullException(nameof(contractAddress)))
public RewardContract(ITransactionProcessor transactionProcessor, IAbiEncoder abiEncoder, Address contractAddress, long transitionBlock, ISpecProvider specProvider)
: base(transactionProcessor, abiEncoder, contractAddress ?? throw new ArgumentNullException(nameof(contractAddress)), specProvider)
{
Activation = transitionBlock;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Nethermind.Abi;
using Nethermind.Blockchain.Contracts;
using Nethermind.Core;
using Nethermind.Core.Specs;
using Nethermind.Int256;
using Nethermind.Evm.TransactionProcessing;

Expand Down Expand Up @@ -97,8 +98,9 @@ protected virtual (ITransactionPermissionContract.TxPermissions, bool) CallAllow
protected TransactionPermissionContract(
IAbiEncoder abiEncoder,
Address contractAddress,
IReadOnlyTxProcessorSource readOnlyTxProcessorSource)
: base(abiEncoder, contractAddress)
IReadOnlyTxProcessorSource readOnlyTxProcessorSource,
ISpecProvider specProvider)
: base(specProvider, abiEncoder, contractAddress)
{
Constant = new PermissionConstantContract(this, readOnlyTxProcessorSource);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using Nethermind.Abi;
using Nethermind.Core;
using Nethermind.Core.Specs;
using Nethermind.Int256;
using Nethermind.Evm.TransactionProcessing;

Expand All @@ -14,14 +15,16 @@ public sealed class TransactionPermissionContractV1 : TransactionPermissionContr
public TransactionPermissionContractV1(
IAbiEncoder abiEncoder,
Address contractAddress,
IReadOnlyTxProcessorSource readOnlyTxProcessorSource)
: base(abiEncoder, contractAddress ?? throw new ArgumentNullException(nameof(contractAddress)), readOnlyTxProcessorSource)
IReadOnlyTxProcessorSource readOnlyTxProcessorSource,
ISpecProvider specProvider)
: base(abiEncoder, contractAddress ?? throw new ArgumentNullException(nameof(contractAddress)), readOnlyTxProcessorSource, specProvider)
{
}

protected override object[] GetAllowedTxTypesParameters(Transaction tx, BlockHeader parentHeader) => new object[] { tx.SenderAddress };

protected override (ITransactionPermissionContract.TxPermissions, bool) CallAllowedTxTypes(PermissionConstantContract.PermissionCallInfo callInfo) =>
protected override (ITransactionPermissionContract.TxPermissions, bool) CallAllowedTxTypes(
PermissionConstantContract.PermissionCallInfo callInfo) =>
(Constant.Call<ITransactionPermissionContract.TxPermissions>(callInfo), true);

public override UInt256 Version => UInt256.One;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using Nethermind.Abi;
using Nethermind.Core;
using Nethermind.Core.Specs;
using Nethermind.Int256;
using Nethermind.Evm.TransactionProcessing;

Expand All @@ -16,8 +17,9 @@ public sealed class TransactionPermissionContractV2 : TransactionPermissionContr
public TransactionPermissionContractV2(
IAbiEncoder abiEncoder,
Address contractAddress,
IReadOnlyTxProcessorSource readOnlyTxProcessorSource)
: base(abiEncoder, contractAddress ?? throw new ArgumentNullException(nameof(contractAddress)), readOnlyTxProcessorSource)
IReadOnlyTxProcessorSource readOnlyTxProcessorSource,
ISpecProvider specProvider)
: base(abiEncoder, contractAddress ?? throw new ArgumentNullException(nameof(contractAddress)), readOnlyTxProcessorSource, specProvider)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public TransactionPermissionContractV3(
Address contractAddress,
IReadOnlyTxProcessorSource readOnlyTxProcessorSource,
ISpecProvider specProvider)
: base(abiEncoder, contractAddress ?? throw new ArgumentNullException(nameof(contractAddress)), readOnlyTxProcessorSource)
: base(abiEncoder, contractAddress ?? throw new ArgumentNullException(nameof(contractAddress)), readOnlyTxProcessorSource, specProvider)
{
_specProvider = specProvider;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public TransactionPermissionContractV4(
Address contractAddress,
IReadOnlyTxProcessorSource readOnlyTxProcessorSource,
ISpecProvider specProvider)
: base(abiEncoder, contractAddress, readOnlyTxProcessorSource)
: base(abiEncoder, contractAddress, readOnlyTxProcessorSource, specProvider)
{
_specProvider = specProvider;
}
Expand Down
Loading
Loading