From 52623787e05193547138b8a4a122879ff11984cc Mon Sep 17 00:00:00 2001 From: Rohit Ranjan Date: Mon, 17 Jun 2024 18:52:51 +0530 Subject: [PATCH] Remove support of eip3074 from pectra (#7189) --- .../Nethermind.Core/Eip3074Constants.cs | 15 - .../Nethermind.Core/Specs/IReleaseSpec.cs | 7 - .../Nethermind.Evm.Test/Eip3074Tests.cs | 911 ------------------ .../Nethermind.Evm.Test/InvalidOpcodeTests.cs | 4 +- src/Nethermind/Nethermind.Evm/EvmException.cs | 3 +- src/Nethermind/Nethermind.Evm/EvmState.cs | 2 - .../Nethermind.Evm/ExecutionType.cs | 3 +- src/Nethermind/Nethermind.Evm/GasCostOf.cs | 3 - src/Nethermind/Nethermind.Evm/Instruction.cs | 2 - .../Nethermind.Evm/VirtualMachine.cs | 151 +-- .../OverridableReleaseSpec.cs | 1 - .../ChainSpecStyle/ChainParameters.cs | 1 - .../ChainSpecBasedSpecProvider.cs | 1 - .../ChainSpecStyle/ChainSpecLoader.cs | 1 - .../Json/ChainSpecParamsJson.cs | 1 - .../Nethermind.Specs/Forks/18_Prague.cs | 1 - .../Nethermind.Specs/ReleaseSpec.cs | 1 - .../SystemTransactionReleaseSpec.cs | 1 - 18 files changed, 12 insertions(+), 1097 deletions(-) delete mode 100644 src/Nethermind/Nethermind.Core/Eip3074Constants.cs delete mode 100644 src/Nethermind/Nethermind.Evm.Test/Eip3074Tests.cs diff --git a/src/Nethermind/Nethermind.Core/Eip3074Constants.cs b/src/Nethermind/Nethermind.Core/Eip3074Constants.cs deleted file mode 100644 index 1b97f3e7164..00000000000 --- a/src/Nethermind/Nethermind.Core/Eip3074Constants.cs +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited -// SPDX-License-Identifier: LGPL-3.0-only - -namespace Nethermind.Core; - -/// -/// Represents the EIP-3074 parameters. -/// -public class Eip3074Constants -{ - /// - /// Used to prevent signature collision with other signing formats - /// - public const byte AuthMagic = 0x04; -} diff --git a/src/Nethermind/Nethermind.Core/Specs/IReleaseSpec.cs b/src/Nethermind/Nethermind.Core/Specs/IReleaseSpec.cs index 0fd28b93678..ae59f83655d 100644 --- a/src/Nethermind/Nethermind.Core/Specs/IReleaseSpec.cs +++ b/src/Nethermind/Nethermind.Core/Specs/IReleaseSpec.cs @@ -293,11 +293,6 @@ public interface IReleaseSpec : IEip1559Spec, IReceiptSpec /// bool IsEip6780Enabled { get; } - /// - /// https://eips.ethereum.org/EIPS/eip-3074 - /// AUTH and AUTHCALL for EOA - /// - bool IsEip3074Enabled { get; } /// Secp256r1 precompile /// bool IsRip7212Enabled { get; } @@ -401,8 +396,6 @@ public interface IReleaseSpec : IEip1559Spec, IReceiptSpec public bool AuRaSystemCalls { get; } public bool BlobBaseFeeEnabled => IsEip4844Enabled; - bool AuthCallsEnabled => IsEip3074Enabled; - public bool ConsensusRequestsEnabled => WithdrawalRequestsEnabled || DepositsEnabled; } } diff --git a/src/Nethermind/Nethermind.Evm.Test/Eip3074Tests.cs b/src/Nethermind/Nethermind.Evm.Test/Eip3074Tests.cs deleted file mode 100644 index 4bf346b9a3c..00000000000 --- a/src/Nethermind/Nethermind.Evm.Test/Eip3074Tests.cs +++ /dev/null @@ -1,911 +0,0 @@ -// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited -// SPDX-License-Identifier: LGPL-3.0-only - -using Nethermind.Core; -using Nethermind.Core.Crypto; -using Nethermind.Core.Extensions; -using Nethermind.Core.Specs; -using Nethermind.Core.Test.Builders; -using Nethermind.Crypto; -using Nethermind.Int256; -using Nethermind.Logging; -using Nethermind.Specs; -using NUnit.Framework; -using System.Collections.Generic; -using System.Linq; - -namespace Nethermind.Evm.Test -{ - public class Eip3074Tests : VirtualMachineTestsBase - { - protected override ForkActivation Activation => MainnetSpecProvider.PragueActivation; - protected override ulong Timestamp => MainnetSpecProvider.PragueBlockTimestamp; - - protected override TestAllTracerWithOutput CreateTracer() => new() { IsTracingAccess = false }; - - public static IEnumerable AuthorityCombinationCases() - { - yield return new object[] { TestItem.PrivateKeyF, TestItem.AddressF, 0x1 }; - yield return new object[] { TestItem.PrivateKeyE, TestItem.AddressE, 0x1 }; - yield return new object[] { TestItem.PrivateKeyF, TestItem.AddressE, 0x0 }; - yield return new object[] { TestItem.PrivateKeyE, TestItem.AddressF, 0x0 }; - } - - [TestCaseSource(nameof(AuthorityCombinationCases))] - public void ExecuteAuth_SignerIsSameOrDifferentThanAuthority_ReturnsOneOrZero(PrivateKey signer, Address authority, int expected) - { - var data = CreateSignedCommitMessage(signer); - - byte[] code = Prepare.EvmCode - .PushData(data[..32]) - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE) - .PushData(data[32..64]) - .PushSingle(32) - .Op(Instruction.MSTORE) - .PushData(data[64..96]) - .PushSingle(64) - .Op(Instruction.MSTORE) - .PushData(data[96..]) - .PushSingle(96) - .Op(Instruction.MSTORE) - - //Auth params - .PushSingle((UInt256)data.Length) - .Op(Instruction.PUSH0) - .PushData(authority) - .Op(Instruction.AUTH) - - //Return the result of Auth - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE8) - .PushSingle(1) - .Op(Instruction.PUSH0) - .Op(Instruction.RETURN) - .Done; - - var result = Execute(code); - - Assert.That(result.ReturnValue[0], Is.EqualTo(expected)); - } - - public static IEnumerable BadMessageDataCases() - { - yield return new object[] - { - TestContext.CurrentContext.Random.NextByte(5, byte.MaxValue), - ((UInt256)1).ToBigEndian().PadLeft(32), - new UInt256(0).PaddedBytes(32), - SenderRecipientAndMiner.Default.Recipient.Bytes.PadLeft(32) - }; - yield return new object[] - { - Eip3074Constants.AuthMagic, - new UInt256(12999999).PaddedBytes(32), - new UInt256(0).PaddedBytes(32), - SenderRecipientAndMiner.Default.Recipient.Bytes.PadLeft(32) - }; - yield return new object[] - { - Eip3074Constants.AuthMagic, - new UInt256(1).PaddedBytes(32), - new UInt256(99999999999).PaddedBytes(32), - SenderRecipientAndMiner.Default.Recipient.Bytes.PadLeft(32) - }; - yield return new object[] - { - Eip3074Constants.AuthMagic, - new UInt256(1).PaddedBytes(32), - new UInt256(0).PaddedBytes(32), - TestItem.AddressF.Bytes.PadLeft(32) - }; - } - - [TestCaseSource(nameof(BadMessageDataCases))] - public void ExecuteAuth_OneOfMessageArgsIsWrong_ReturnsZero(byte magicNumber, byte[] chainId, byte[] nonce, byte[] address) - { - PrivateKey signer = TestItem.PrivateKeyF; - var data = CreateSignedCommitMessage(signer, magicNumber, chainId, nonce, address, new byte[32]); - - byte[] code = Prepare.EvmCode - .PushData(data[..32]) - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE) - .PushData(data[32..64]) - .PushSingle(32) - .Op(Instruction.MSTORE) - .PushData(data[64..96]) - .PushSingle(64) - .Op(Instruction.MSTORE) - .PushData(data[96..]) - .PushSingle(96) - .Op(Instruction.MSTORE) - - //Auth params - .PushSingle((UInt256)data.Length) - .Op(Instruction.PUSH0) - .PushData(signer.Address) - .Op(Instruction.AUTH) - - //Return the result of Auth - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE8) - .PushSingle(1) - .Op(Instruction.PUSH0) - .Op(Instruction.RETURN) - .Done; - - var result = Execute(code); - - Assert.That(result.ReturnValue[0], Is.EqualTo(0)); - } - - [Test] - public void ExecuteAuth_CommitDataIsWrong_ReturnsZero() - { - PrivateKey signer = TestItem.PrivateKeyF; - var data = CreateSignedCommitMessage(signer); - //Start index of commit - data[65] = 0x1; - - byte[] code = Prepare.EvmCode - .PushData(data[..32]) - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE) - .PushData(data[32..64]) - .PushSingle(32) - .Op(Instruction.MSTORE) - .PushData(data[64..96]) - .PushSingle(64) - .Op(Instruction.MSTORE) - .PushData(data[96..]) - .PushSingle(96) - .Op(Instruction.MSTORE) - - //Auth params - .PushSingle((UInt256)data.Length) - .Op(Instruction.PUSH0) - .PushData(signer.Address) - .Op(Instruction.AUTH) - - //Return the result of Auth - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE8) - .PushSingle(1) - .Op(Instruction.PUSH0) - .Op(Instruction.RETURN) - .Done; - - var result = Execute(code); - - Assert.That(result.ReturnValue[0], Is.EqualTo(0)); - } - - [TestCase(true, 0)] - [TestCase(false, 1)] - public void ExecuteAuth_SignerNonceIsIncrementedAfterSigning_ReturnsExpected(bool incrementNonce, int expected) - { - var signer = TestItem.PrivateKeyF; - var data = CreateSignedCommitMessage(signer); - - TestState.CreateAccount(signer.Address, 1.Ether()); - if (incrementNonce) - TestState.IncrementNonce(signer.Address); - - byte[] code = Prepare.EvmCode - .PushData(data[..32]) - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE) - .PushData(data[32..64]) - .PushSingle(32) - .Op(Instruction.MSTORE) - .PushData(data[64..96]) - .PushSingle(64) - .Op(Instruction.MSTORE) - - //Auth params - .PushSingle((UInt256)data.Length) - .Op(Instruction.PUSH0) - .PushData(signer.Address) - .Op(Instruction.AUTH) - - //Return the result of Auth - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE8) - .PushSingle(1) - .Op(Instruction.PUSH0) - .Op(Instruction.RETURN) - .Done; - - var result = Execute(code); - - Assert.That(result.ReturnValue[0], Is.EqualTo(expected)); - } - - [Test] - public void ExecuteAuth_InvalidAuthorityAfterValidHasBeenSet_CorrectErrorIsReturned() - { - var signer = TestItem.PrivateKeyF; - var data = CreateSignedCommitMessage(signer); - - byte[] code = Prepare.EvmCode - .PushData(data[..32]) - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE) - .PushData(data[32..64]) - .PushSingle(32) - .Op(Instruction.MSTORE) - .PushData(data[64..96]) - .PushSingle(64) - .Op(Instruction.MSTORE) - - //Auth params - .PushSingle((UInt256)data.Length) - .Op(Instruction.PUSH0) - .PushData(signer.Address) - .Op(Instruction.AUTH) - - //Wrong authority - .PushSingle((UInt256)data.Length) - .Op(Instruction.PUSH0) - .PushData(TestItem.GetRandomAddress()) - .Op(Instruction.AUTH) - - .PushData(20) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(TestItem.AddressC) - .PushData(1000000) - .Op(Instruction.AUTHCALL) - .Done; - - var result = Execute(code); - - Assert.That(result.StatusCode, Is.EqualTo(0)); - Assert.That(result.Error, Is.EqualTo(EvmExceptionType.AuthorizedNotSet.ToString())); - } - - [TestCase(66, 1)] - [TestCase(65, 1)] - [TestCase(256, 1)] - [TestCase(64, 0)] - [TestCase(0, 0)] - public void ExecuteAuth_ParamLengthIsLessOrGreaterThanValidSignature_ReturnsExpected(int paramLength, int expected) - { - var signer = TestItem.PrivateKeyF; - var data = CreateSignedCommitMessage(signer); - - byte[] code = Prepare.EvmCode - .PushData(data[..32]) - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE) - .PushData(data[32..64]) - .PushSingle(32) - .Op(Instruction.MSTORE) - .PushData(data[64..96]) - .PushSingle(64) - .Op(Instruction.MSTORE) - - //Auth params - .PushSingle((UInt256)paramLength) - .Op(Instruction.PUSH0) - .PushData(signer.Address) - .Op(Instruction.AUTH) - - //Return the result of Auth - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE8) - .PushSingle(1) - .Op(Instruction.PUSH0) - .Op(Instruction.RETURN) - .Done; - - var result = Execute(code); - - Assert.That(result.ReturnValue[0], Is.EqualTo(expected)); - } - - - [Test] - public void ExecuteAuth_SignatureIsInvalid_ReturnsZero() - { - var data = new byte[97]; - TestContext.CurrentContext.Random.NextBytes(data); - - byte[] code = Prepare.EvmCode - .PushData(data[..32]) - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE) - .PushData(data[32..64]) - .PushSingle(32) - .Op(Instruction.MSTORE) - .PushData(data[64..96]) - .PushSingle(64) - .Op(Instruction.MSTORE) - - //Auth params - .PushSingle((UInt256)data.Length) - .Op(Instruction.PUSH0) - .PushData(TestItem.AddressA) - .Op(Instruction.AUTH) - - //Return the result of Auth - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE8) - .PushSingle(1) - .Op(Instruction.PUSH0) - .Op(Instruction.RETURN) - .Done; - - var result = Execute(code); - - Assert.That(result.ReturnValue[0], Is.EqualTo(0)); - } - - [TestCase(97, GasCostOf.Auth + GasCostOf.ColdAccountAccess)] - [TestCase(160, GasCostOf.Auth + GasCostOf.Memory + GasCostOf.ColdAccountAccess)] - [TestCase(192, GasCostOf.Auth + GasCostOf.Memory * 2 + GasCostOf.ColdAccountAccess)] - [TestCase(193, GasCostOf.Auth + GasCostOf.Memory * 3 + GasCostOf.ColdAccountAccess)] - public void ExecuteAuth_AuthExpandsMemory_GasCostIsAuthPlusMemoryExpansionAndColdAccountAccess(int authMemoryLength, long expectedGas) - { - var data = CreateSignedCommitMessage(TestItem.PrivateKeyF); - - byte[] code = Prepare.EvmCode - .PushData(data[..32]) - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE) - .PushData(data[32..64]) - .PushSingle(32) - .Op(Instruction.MSTORE) - .PushData(data[64..96]) - .PushSingle(64) - .Op(Instruction.MSTORE) - .PushData(data[96..]) - .PushSingle(96) - .Op(Instruction.MSTORE) - - .PushSingle((UInt256)authMemoryLength) - .Op(Instruction.PUSH0) - .PushData(TestItem.AddressF) - .Done; - - var authCode = - code.Concat( - Prepare.EvmCode - .Op(Instruction.AUTH) - .Done - ).ToArray(); - - TestState.CreateAccount(TestItem.AddressC, 0); - TestState.InsertCode(TestItem.AddressC, Keccak.Compute(code), code, Spec); - - TestState.CreateAccount(TestItem.AddressD, 0); - TestState.InsertCode(TestItem.AddressD, Keccak.Compute(authCode), authCode, Spec); - - var resultNoAuth = Execute(code); - var resultWithAuth = Execute(authCode); - - Assert.That(resultWithAuth.GasSpent - resultNoAuth.GasSpent, Is.EqualTo(expectedGas)); - } - - [Test] - public void ExecuteAuthCall_TransactionReturnsTheCurrentCallerAfterAuthCall_SignerIsReturned() - { - var signer = TestItem.PrivateKeyF; - var data = CreateSignedCommitMessage(signer); - - byte[] code = Prepare.EvmCode - .PushData(data[..32]) - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE) - .PushData(data[32..64]) - .PushSingle(32) - .Op(Instruction.MSTORE) - .PushData(data[64..96]) - .PushSingle(64) - .Op(Instruction.MSTORE) - - //Auth params - .PushSingle((UInt256)data.Length) - .Op(Instruction.PUSH0) - .PushData(signer.Address) - .Op(Instruction.AUTH) - - //Just throw away the result - .POP() - - //AuthCall params - .PushData(20) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(TestItem.AddressC) - .PushData(0) - .Op(Instruction.AUTHCALL) - .PushSingle(20) - .PushSingle(0) - .Op(Instruction.RETURN) - .Done; - - //Simply returns the current msg.caller - byte[] codeReturnCaller = Prepare.EvmCode - .CALLER() - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE) - .PushSingle(20) - .PushSingle(12) - .Op(Instruction.RETURN) - .Done; - - TestState.CreateAccount(TestItem.AddressC, 0); - TestState.InsertCode(TestItem.AddressC, Keccak.Compute(codeReturnCaller), codeReturnCaller, Spec); - - var result = Execute(code); - - Assert.That(new Address(result.ReturnValue), Is.EqualTo(signer.Address)); - } - - public static IEnumerable AuthCallGasCases() - { - yield return new object[] - { - //Cold access address - TestItem.GetRandomAddress(), - 0, - GasCostOf.ColdAccountAccess, - }; - yield return new object[] - { - //Warm access address - TestItem.AddressF, - 0, - GasCostOf.WarmStateRead, - }; - yield return new object[] - { - //Warm access address - TestItem.AddressF, - 1, - GasCostOf.AuthCallValue + GasCostOf.WarmStateRead, - }; - } - - [TestCaseSource(nameof(AuthCallGasCases))] - public void ExecuteAuthCall_VarmAndColdAddressesAndValueIsZeroOrGreater_UsesCorrectAmountOfGas(Address target, long valueToSend, long expectedCost) - { - var signer = TestItem.PrivateKeyF; - var data = CreateSignedCommitMessage(signer); - - byte[] code = Prepare.EvmCode - .PushData(data[..32]) - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE) - .PushData(data[32..64]) - .PushSingle(32) - .Op(Instruction.MSTORE) - .PushData(data[64..96]) - .PushSingle(64) - .Op(Instruction.MSTORE) - - //Auth params - .PushSingle((UInt256)data.Length) - .Op(Instruction.PUSH0) - .PushData(signer.Address) - .Op(Instruction.AUTH) - - //Just throw away the result - .POP() - - //AuthCall params - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(valueToSend) - .PushData(target) - .PushData(0) - .Done; - - var codeWithAuthCall = code.Concat( - Prepare.EvmCode - .Op(Instruction.AUTHCALL) - .Done).ToArray(); - - TestState.CreateAccount(signer.Address, 1.Ether()); - - TestState.CreateAccount(TestItem.AddressC, 0); - TestState.InsertCode(TestItem.AddressC, Keccak.Compute(code), code, Spec); - - TestState.CreateAccount(TestItem.AddressD, 0); - TestState.InsertCode(TestItem.AddressD, Keccak.Compute(codeWithAuthCall), codeWithAuthCall, Spec); - - var result = Execute(code); - var resultWithAuthCall = Execute(codeWithAuthCall); - - Assert.That(resultWithAuthCall.GasSpent - result.GasSpent, Is.EqualTo(expectedCost)); - } - - [TestCase(1000000, 30000, 30000 - GasCostOf.Gas)] - //If gas limit is 0, all gas should be forwarded remaining after the AuthCall ops and 63/64 rule - [TestCase(1000000, 0, 970631 - 970631 / 64 - GasCostOf.Gas)] - [TestCase(1000000, 970631 - 970631 / 64, 970631 - 970631 / 64 - GasCostOf.Gas)] - public void ExecuteAuthCall_GasLimitIsSetToZeroOrGreater_CorrectAmountOfGasIsForwarded(long gasLimit, long gasToSend, long expectedGasInSubcall) - { - var signer = TestItem.PrivateKeyF; - var data = CreateSignedCommitMessage(signer); - - byte[] code = Prepare.EvmCode - .PushData(data[..32]) - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE) - .PushData(data[32..64]) - .PushSingle(32) - .Op(Instruction.MSTORE) - .PushData(data[64..96]) - .PushSingle(64) - .Op(Instruction.MSTORE) - - //Auth params - .PushSingle((UInt256)data.Length) - .Op(Instruction.PUSH0) - .PushData(signer.Address) - .Op(Instruction.AUTH) - - //Just throw away the result - .POP() - - //AuthCall params - .PushData(32) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(TestItem.AddressC) - .PushData(gasToSend) - .Op(Instruction.AUTHCALL) - .PushSingle(32) - .PushSingle(0) - .Op(Instruction.RETURN) - .Done; - - var codeStoreGas = Prepare.EvmCode - .GAS() - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE) - .PushSingle(32) - .Op(Instruction.PUSH0) - .Op(Instruction.RETURN) - .Done; - - TestState.CreateAccount(TestItem.AddressC, 0); - TestState.InsertCode(TestItem.AddressC, Keccak.Compute(codeStoreGas), codeStoreGas, Spec); - - var result = ExecuteAndTrace(gasLimit, code); - - Assert.That(new UInt256(result.ReturnValue, true), Is.EqualTo((UInt256)expectedGasInSubcall)); - } - - [TestCase(1000000000, EvmExceptionType.OutOfGas)] - //Set gas limit to exactly remaining gas after AuthCall + 1 - [TestCase(70631 - 70631 / 64 + 1, EvmExceptionType.OutOfGas)] - [TestCase(70631 - 70631 / 64, null)] - public void ExecuteAuthCall_GasLimitIsHigherThanRemainingGas_ReturnsOutOfGas(long gasLimit, EvmExceptionType? expectedErrorType) - { - var signer = TestItem.PrivateKeyF; - var data = CreateSignedCommitMessage(signer); - - byte[] code = Prepare.EvmCode - .PushData(data[..32]) - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE) - .PushData(data[32..64]) - .PushSingle(32) - .Op(Instruction.MSTORE) - .PushData(data[64..96]) - .PushSingle(64) - .Op(Instruction.MSTORE) - - //Auth params - .PushSingle((UInt256)data.Length) - .Op(Instruction.PUSH0) - .PushData(signer.Address) - .Op(Instruction.AUTH) - - //Just throw away the result - .POP() - - //AuthCall params - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(TestItem.GetRandomAddress()) - .PushData(gasLimit) - .Op(Instruction.AUTHCALL) - .Done; - - var result = Execute(code); - - Assert.That(result.Error, Is.EqualTo(expectedErrorType?.ToString())); - } - - [Test] - public void ExecuteAuthCall_1GweiIsSent_SignerIsDebitedAndReceiverCredited() - { - var signer = TestItem.PrivateKeyF; - var data = CreateSignedCommitMessage(signer); - Address receiver = TestItem.GetRandomAddress(); - UInt256 valueToSend = 1.GWei(); - byte[] code = Prepare.EvmCode - .PushData(data[..32]) - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE) - .PushData(data[32..64]) - .PushSingle(32) - .Op(Instruction.MSTORE) - .PushData(data[64..96]) - .PushSingle(64) - .Op(Instruction.MSTORE) - - //Auth params - .PushSingle((UInt256)data.Length) - .Op(Instruction.PUSH0) - .PushData(signer.Address) - .Op(Instruction.AUTH) - - //Just throw away the result - .POP() - - //AuthCall params - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(valueToSend) - .PushData(receiver) - .PushData(0) - .Op(Instruction.AUTHCALL) - .Done; - - TestState.CreateAccount(signer.Address, 1.Ether()); - - Execute(code); - - var signerBalance = TestState.GetBalance(signer.Address); - var receiverBalance = TestState.GetBalance(receiver); - - Assert.That(signerBalance, Is.EqualTo(1.Ether() - valueToSend)); - Assert.That(receiverBalance, Is.EqualTo(valueToSend)); - } - - [Test] - public void ExecuteAuthCall_SendingMoreThanSignerBalance_SignerBalanceIsSame() - { - var signer = TestItem.PrivateKeyF; - var data = CreateSignedCommitMessage(signer); - - Address receivingAddress = TestItem.AddressC; - byte[] code = Prepare.EvmCode - .PushData(data[..32]) - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE) - .PushData(data[32..64]) - .PushSingle(32) - .Op(Instruction.MSTORE) - .PushData(data[64..96]) - .PushSingle(64) - .Op(Instruction.MSTORE) - - //Auth params - .PushSingle((UInt256)data.Length) - .Op(Instruction.PUSH0) - .PushData(signer.Address) - .Op(Instruction.AUTH) - - //Just throw away the result - .POP() - - //AuthCall params - .PushData(20) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(1.Ether() + 1) - .PushData(receivingAddress) - .PushData(1000000) - .Op(Instruction.AUTHCALL) - .Done; - - TestState.CreateAccount(signer.Address, 1.Ether()); - - Execute(code); - - var signerBalance = TestState.GetBalance(signer.Address); - var receiverBalance = TestState.GetBalance(receivingAddress); - - Assert.That(signerBalance, Is.EqualTo(1.Ether())); - Assert.That(receiverBalance, Is.EqualTo((UInt256)0)); - } - - [Test] - public void ExecuteAuthCall_SignerHasCodeDeployed_AuthorizedHasNotBeenSet() - { - var signer = TestItem.PrivateKeyF; - var data = CreateSignedCommitMessage(signer); - - byte[] code = Prepare.EvmCode - .PushData(data[..32]) - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE) - .PushData(data[32..64]) - .PushSingle(32) - .Op(Instruction.MSTORE) - .PushData(data[64..96]) - .PushSingle(64) - .Op(Instruction.MSTORE) - - //Auth params - .PushSingle((UInt256)data.Length) - .Op(Instruction.PUSH0) - .PushData(signer.Address) - .Op(Instruction.AUTH) - - //AuthCall params - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(TestItem.GetRandomAddress()) - .PushData(0) - .Op(Instruction.AUTHCALL) - .Done; - - var signerCode = Prepare.EvmCode - .Op(Instruction.STOP) - .Done; - - TestState.CreateAccount(signer.Address, 0); - TestState.InsertCode(signer.Address, Keccak.Compute(signerCode), signerCode, Spec); - - var result = Execute(code); - - Assert.That(result.Error, Is.EqualTo(EvmExceptionType.AuthorizedNotSet.ToString())); - } - - [Test] - public void ExecuteAuthCall_AuthCallIsCalledTwiceInSameFrame_AuthorizedIsStillSet() - { - var signer = TestItem.PrivateKeyF; - var data = CreateSignedCommitMessage(signer); - - byte[] code = Prepare.EvmCode - .PushData(data[..32]) - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE) - .PushData(data[32..64]) - .PushSingle(32) - .Op(Instruction.MSTORE) - .PushData(data[64..96]) - .PushSingle(64) - .Op(Instruction.MSTORE) - - //Auth params - .PushSingle((UInt256)data.Length) - .Op(Instruction.PUSH0) - .PushData(signer.Address) - .Op(Instruction.AUTH) - - //AuthCall params - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(TestItem.GetRandomAddress()) - .PushData(0) - .Op(Instruction.AUTHCALL) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(TestItem.GetRandomAddress()) - .PushData(0) - .Op(Instruction.AUTHCALL) - .Done; - - var result = Execute(code); - - Assert.That(result.Error, Is.EqualTo(null)); - } - - [Test] - public void ExecuteAuthCall_AuthorizedIsSetAndAuthCallIsCalledInSubcall_AuthorizedIsNotSetInSubcall() - { - var signer = TestItem.PrivateKeyF; - var data = CreateSignedCommitMessage(signer); - - byte[] code = Prepare.EvmCode - .PushData(data[..32]) - .Op(Instruction.PUSH0) - .Op(Instruction.MSTORE) - .PushData(data[32..64]) - .PushSingle(32) - .Op(Instruction.MSTORE) - .PushData(data[64..96]) - .PushSingle(64) - .Op(Instruction.MSTORE) - - //Auth params - .PushSingle((UInt256)data.Length) - .Op(Instruction.PUSH0) - .PushData(signer.Address) - .Op(Instruction.AUTH) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(TestItem.AddressC) - .PushData(10000) - .Op(Instruction.CALL) - .Done; - - var authCall = Prepare.EvmCode - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(0) - .PushData(TestItem.GetRandomAddress()) - .PushData(0) - .Op(Instruction.AUTHCALL) - .Done; - - TestState.CreateAccount(TestItem.AddressC, 0); - TestState.InsertCode(TestItem.AddressC, Keccak.Compute(authCall), authCall, Spec); - - var result = ExecuteAndTrace(code); - Assert.That(result.Entries.Last(e => e.Opcode.Equals(Instruction.AUTHCALL.ToString())).Error, Is.Not.Null); - } - - private byte[] CreateSignedCommitMessage(PrivateKey signer) - { - return CreateSignedCommitMessage( - signer, - Eip3074Constants.AuthMagic, - ((UInt256)SpecProvider.ChainId).ToBigEndian().PadLeft(32), - TestState.GetNonce(signer.Address).PaddedBytes(32), - SenderRecipientAndMiner.Default.Recipient.Bytes.PadLeft(32), - new byte[32] - ); - } - - private byte[] CreateSignedCommitMessage(PrivateKey signer, byte magicNumber, byte[] chainId, byte[] nonce, byte[] address, byte[] commit) - { - List msg = - [ - magicNumber, - .. chainId, - .. nonce, - .. address, - .. commit - ]; - - Hash256 msgDigest = Keccak.Compute(msg.ToArray()); - EthereumEcdsa ecdsa = new EthereumEcdsa(SpecProvider.ChainId, LimboLogs.Instance); - - Signature signature = ecdsa.Sign(signer, msgDigest); - //Recovery id/yParity needs to be at index 0 - var data = signature.BytesWithRecovery[64..] - .Concat(signature.BytesWithRecovery[..64]) - .Concat(commit).ToArray(); - return data; - } - } -} diff --git a/src/Nethermind/Nethermind.Evm.Test/InvalidOpcodeTests.cs b/src/Nethermind/Nethermind.Evm.Test/InvalidOpcodeTests.cs index 66fb59e7fc4..7c43f8a4e30 100644 --- a/src/Nethermind/Nethermind.Evm.Test/InvalidOpcodeTests.cs +++ b/src/Nethermind/Nethermind.Evm.Test/InvalidOpcodeTests.cs @@ -116,8 +116,8 @@ public class InvalidOpcodeTests : VirtualMachineTestsBase CancunInstructions.Union( new Instruction[] { - Instruction.AUTH, - Instruction.AUTHCALL + // Instruction.AUTH, + // Instruction.AUTHCALL } ).ToArray(); diff --git a/src/Nethermind/Nethermind.Evm/EvmException.cs b/src/Nethermind/Nethermind.Evm/EvmException.cs index d7dad8b4efe..7bc74c52c79 100644 --- a/src/Nethermind/Nethermind.Evm/EvmException.cs +++ b/src/Nethermind/Nethermind.Evm/EvmException.cs @@ -28,7 +28,6 @@ public enum EvmExceptionType NotEnoughBalance, Other, Revert, - InvalidCode, - AuthorizedNotSet + InvalidCode } } diff --git a/src/Nethermind/Nethermind.Evm/EvmState.cs b/src/Nethermind/Nethermind.Evm/EvmState.cs index 9c40779f36c..cd2fa29cb3a 100644 --- a/src/Nethermind/Nethermind.Evm/EvmState.cs +++ b/src/Nethermind/Nethermind.Evm/EvmState.cs @@ -217,7 +217,6 @@ public Address From case ExecutionType.CREATE: case ExecutionType.CREATE2: case ExecutionType.TRANSACTION: - case ExecutionType.AUTHCALL: return Env.Caller; case ExecutionType.DELEGATECALL: return Env.ExecutingAccount; @@ -232,7 +231,6 @@ public Address From public long Refund { get; set; } public Address To => Env.CodeSource ?? Env.ExecutingAccount; - public Address? Authorized { get; set; } internal bool IsPrecompile => Env.CodeInfo.IsPrecompile; public readonly ExecutionEnvironment Env; diff --git a/src/Nethermind/Nethermind.Evm/ExecutionType.cs b/src/Nethermind/Nethermind.Evm/ExecutionType.cs index 946d25d5e38..f0ce0c67737 100644 --- a/src/Nethermind/Nethermind.Evm/ExecutionType.cs +++ b/src/Nethermind/Nethermind.Evm/ExecutionType.cs @@ -36,8 +36,7 @@ public enum ExecutionType CALLCODE, DELEGATECALL, CREATE, - CREATE2, - AUTHCALL + CREATE2 } // ReSharper restore IdentifierTypo InconsistentNaming } diff --git a/src/Nethermind/Nethermind.Evm/GasCostOf.cs b/src/Nethermind/Nethermind.Evm/GasCostOf.cs index 55f1f7ce571..68dc8cae654 100644 --- a/src/Nethermind/Nethermind.Evm/GasCostOf.cs +++ b/src/Nethermind/Nethermind.Evm/GasCostOf.cs @@ -62,8 +62,5 @@ public static class GasCostOf public const long AccessStorageListEntry = 1900; // eip-2930 public const long TLoad = WarmStateRead; // eip-1153 public const long TStore = WarmStateRead; // eip-1153 - public const long Auth = 3100; // eip-3074 - public const long AuthCallValue = CallValue - CallStipend; // eip-3074 - public const long Gas = Base; } } diff --git a/src/Nethermind/Nethermind.Evm/Instruction.cs b/src/Nethermind/Nethermind.Evm/Instruction.cs index 61d5f1e2502..96fcf3f3595 100644 --- a/src/Nethermind/Nethermind.Evm/Instruction.cs +++ b/src/Nethermind/Nethermind.Evm/Instruction.cs @@ -171,8 +171,6 @@ public enum Instruction : byte REVERT = 0xfd, INVALID = 0xfe, SELFDESTRUCT = 0xff, - AUTH = 0xf6, - AUTHCALL = 0xf7, } public static class InstructionExtensions diff --git a/src/Nethermind/Nethermind.Evm/VirtualMachine.cs b/src/Nethermind/Nethermind.Evm/VirtualMachine.cs index e014afb41f6..8f497baa21b 100644 --- a/src/Nethermind/Nethermind.Evm/VirtualMachine.cs +++ b/src/Nethermind/Nethermind.Evm/VirtualMachine.cs @@ -30,7 +30,6 @@ namespace Nethermind.Evm; using System.Linq; using Int256; -using Nethermind.Crypto; public class VirtualMachine : IVirtualMachine @@ -89,7 +88,6 @@ internal readonly ref struct CallResult public static CallResult StackOverflowException => new(EvmExceptionType.StackOverflow); // TODO: use these to avoid CALL POP attacks public static CallResult StackUnderflowException => new(EvmExceptionType.StackUnderflow); // TODO: use these to avoid CALL POP attacks public static CallResult InvalidCodeException => new(EvmExceptionType.InvalidCode); - public static CallResult AuthorizedNotSet => new(EvmExceptionType.AuthorizedNotSet); public static CallResult Empty => new(default, null); public static object BoxedEmpty { get; } = new object(); @@ -149,8 +147,6 @@ internal sealed class VirtualMachine : IVirtualMachine where TLogger : private ITxTracer _txTracer = NullTxTracer.Instance; private readonly ICodeInfoRepository _codeInfoRepository; - private EthereumEcdsa _ecdsa; - public VirtualMachine( IBlockhashProvider? blockhashProvider, ISpecProvider? specProvider, @@ -162,7 +158,6 @@ public VirtualMachine( _specProvider = specProvider ?? throw new ArgumentNullException(nameof(specProvider)); _codeInfoRepository = codeInfoRepository ?? throw new ArgumentNullException(nameof(codeInfoRepository)); _chainId = ((UInt256)specProvider.ChainId).ToBigEndian(); - _ecdsa = new EthereumEcdsa(specProvider.ChainId, LimboLogs.Instance); } public TransactionSubstate Run(EvmState state, IWorldState worldState, ITxTracer txTracer) @@ -1605,7 +1600,7 @@ private CallResult ExecuteCode(vmState, ref stack, ref gasAvailable, spec, instruction, out returnData); if (exceptionType != EvmExceptionType.None) goto ReturnFailure; @@ -1973,13 +1967,6 @@ private CallResult ExecuteCode throw new OperationCanceledException("Cancellation Requested"); } - [SkipLocalsInit] - private EvmExceptionType InstructionAuth(EvmState vmState, ref EvmStack stack, ref long gasAvailable, IReleaseSpec spec) where TTracingInstructions : struct, IIsTracing - { - if (!spec.AuthCallsEnabled) return EvmExceptionType.BadInstruction; - Address authority = stack.PopAddress(); - - if (authority is null) return EvmExceptionType.StackUnderflow; - - if (!stack.PopUInt256(out UInt256 offset)) return EvmExceptionType.StackUnderflow; - if (!stack.PopUInt256(out UInt256 length)) return EvmExceptionType.StackUnderflow; - gasAvailable -= GasCostOf.Auth; - - if (!UpdateMemoryCost(vmState, ref gasAvailable, offset, length)) - return EvmExceptionType.OutOfGas; - - if (!ChargeAccountAccessGas(ref gasAvailable, vmState, authority, spec)) - return EvmExceptionType.OutOfGas; - - if (_state.IsContract(authority)) - { - vmState.Authorized = null; - stack.PushUInt256(0); - return EvmExceptionType.None; - } - - ReadOnlySpan memData = vmState.Memory.Load(in offset, length).Span; - - byte yParity = 0; - Span sigData = stackalloc byte[64]; - Span commit = stackalloc byte[32]; - //SkipLocalsInit flag is active so we have to iterate all data - for (int i = 0; i < 97; i++) - { - byte data = 0; - if (i < length) - data = memData[i]; - switch (i) - { - case 0: - yParity = data; - break; - case >= 1 and <= 64: - sigData[i - 1] = data; - break; - default: - commit[i - 65] = data; - break; - } - } - Signature signature = new(sigData, yParity); - - Address recovered = null; - if (signature.V == Signature.VOffset || signature.V == Signature.VOffset + 1) - { - //TODO is ExecutingAccount correct when DELEGATECALL and CALLCODE? - recovered = TryRecoverSigner(signature, vmState.Env.ExecutingAccount, authority, commit); - } - - if (recovered == authority) - { - stack.PushUInt256(1); - vmState.Authorized = authority; - } - else - { - stack.PushUInt256(0); - vmState.Authorized = null; - } - return EvmExceptionType.None; - } - - private Address? TryRecoverSigner( - Signature signature, - Address invoker, - Address authority, - ReadOnlySpan commit) - { - UInt256 nonce = _state.GetNonce(authority); - byte[] invokerAddress = invoker.Bytes; - Span msg = stackalloc byte[1 + 32 * 4]; - msg[0] = Eip3074Constants.AuthMagic; - for (int i = 0; i < 32; i++) - { - int offset = i + 1; - msg[offset] = _chainId[i]; - msg[32 + 32 - i] = (byte)(nonce[i / 8] >> (8 * (i % 8))); - - if (i < 12) - msg[offset + 64] = 0; - else if (i - 12 < invokerAddress.Length) - msg[offset + 64] = invokerAddress[i - 12]; - - if (i < commit.Length) - msg[offset + 96] = commit[i]; - } - - return _ecdsa.RecoverAddress(signature, Keccak.Compute(msg)); - } - [SkipLocalsInit] [MethodImpl(MethodImplOptions.NoInlining)] private void InstructionExtCodeSize(Address address, ref EvmStack stack, IReleaseSpec spec) where TTracingInstructions : struct, IIsTracing @@ -2168,13 +2056,7 @@ private EvmExceptionType InstructionCall( Metrics.IncrementCalls(); if (instruction == Instruction.DELEGATECALL && !spec.DelegateCallEnabled || - instruction == Instruction.STATICCALL && !spec.StaticCallEnabled || - instruction == Instruction.AUTHCALL && !spec.AuthCallsEnabled) return EvmExceptionType.BadInstruction; - - if (instruction == Instruction.AUTHCALL && vmState.Authorized is null) - { - return EvmExceptionType.AuthorizedNotSet; - } + instruction == Instruction.STATICCALL && !spec.StaticCallEnabled) return EvmExceptionType.BadInstruction; if (!stack.PopUInt256(out UInt256 gasLimit)) return EvmExceptionType.StackUnderflow; Address codeSource = stack.PopAddress(); @@ -2204,14 +2086,9 @@ private EvmExceptionType InstructionCall( if (vmState.IsStatic && !transferValue.IsZero && instruction != Instruction.CALLCODE) return EvmExceptionType.StaticCallViolation; - Address caller = instruction switch - { - Instruction.DELEGATECALL => env.Caller, - Instruction.AUTHCALL => vmState.Authorized, - _ => env.ExecutingAccount - }; + Address caller = instruction == Instruction.DELEGATECALL ? env.Caller : env.ExecutingAccount; - Address target = instruction is Instruction.CALL or Instruction.STATICCALL or Instruction.AUTHCALL + Address target = instruction == Instruction.CALL || instruction == Instruction.STATICCALL ? codeSource : env.ExecutingAccount; @@ -2224,7 +2101,7 @@ private EvmExceptionType InstructionCall( if (!transferValue.IsZero) { - gasExtra += instruction == Instruction.AUTHCALL ? GasCostOf.AuthCallValue : GasCostOf.CallValue; + gasExtra += GasCostOf.CallValue; } if (!spec.ClearEmptyAccountWhenTouched && !_state.AccountExists(target)) @@ -2246,16 +2123,7 @@ private EvmExceptionType InstructionCall( if (spec.Use63Over64Rule) { - UInt256 sixtyFourthDeducted = (UInt256)(gasAvailable - gasAvailable / 64); - if (instruction == Instruction.AUTHCALL) - { - //AUTHCALL forwards all, if gas param is zero - if (gasLimit == 0) - gasLimit = sixtyFourthDeducted; - else if (sixtyFourthDeducted < gasLimit) - return EvmExceptionType.OutOfGas; - } - gasLimit = UInt256.Min(sixtyFourthDeducted, gasLimit); + gasLimit = UInt256.Min((UInt256)(gasAvailable - gasAvailable / 64), gasLimit); } if (gasLimit >= long.MaxValue) return EvmExceptionType.OutOfGas; @@ -2263,14 +2131,13 @@ private EvmExceptionType InstructionCall( long gasLimitUl = (long)gasLimit; if (!UpdateGas(gasLimitUl, ref gasAvailable)) return EvmExceptionType.OutOfGas; - if (!transferValue.IsZero && instruction != Instruction.AUTHCALL) + if (!transferValue.IsZero) { if (typeof(TTracingRefunds) == typeof(IsTracing)) _txTracer.ReportExtraGasPressure(GasCostOf.CallStipend); gasLimitUl += GasCostOf.CallStipend; } - Address accountToDebit = instruction == Instruction.AUTHCALL ? vmState.Authorized! : env.ExecutingAccount; - if (env.CallDepth >= MaxCallDepth || !transferValue.IsZero && _state.GetBalance(accountToDebit) < transferValue) + if (env.CallDepth >= MaxCallDepth || !transferValue.IsZero && _state.GetBalance(env.ExecutingAccount) < transferValue) { _returnDataBuffer = Array.Empty(); stack.PushZero(); @@ -2816,7 +2683,6 @@ private CallResult GetFailureReturn(long gasAvailable, Evm EvmExceptionType.StackUnderflow => CallResult.StackUnderflowException, EvmExceptionType.InvalidJumpDestination => CallResult.InvalidJumpDestination, EvmExceptionType.AccessViolation => CallResult.AccessViolationException, - EvmExceptionType.AuthorizedNotSet => CallResult.AuthorizedNotSet, _ => throw new ArgumentOutOfRangeException(nameof(exceptionType), exceptionType, "") }; } @@ -2901,7 +2767,6 @@ private static ExecutionType GetCallExecutionType(Instruction instruction, bool Instruction.DELEGATECALL => ExecutionType.DELEGATECALL, Instruction.STATICCALL => ExecutionType.STATICCALL, Instruction.CALLCODE => ExecutionType.CALLCODE, - Instruction.AUTHCALL => ExecutionType.AUTHCALL, _ => throw new NotSupportedException($"Execution type is undefined for {instruction.GetName(isPostMerge)}") }; } diff --git a/src/Nethermind/Nethermind.Specs.Test/OverridableReleaseSpec.cs b/src/Nethermind/Nethermind.Specs.Test/OverridableReleaseSpec.cs index 1d5396d41b9..c960c3a836e 100644 --- a/src/Nethermind/Nethermind.Specs.Test/OverridableReleaseSpec.cs +++ b/src/Nethermind/Nethermind.Specs.Test/OverridableReleaseSpec.cs @@ -160,7 +160,6 @@ public ulong Eip4844TransitionTimestamp public Address Eip7002ContractAddress => _spec.Eip7002ContractAddress; public bool IsEip2935Enabled => _spec.IsEip2935Enabled; public Address Eip2935ContractAddress => _spec.Eip2935ContractAddress; - public bool IsEip3074Enabled => _spec.IsEip3074Enabled; public UInt256 ForkBaseFee => _spec.ForkBaseFee; public UInt256 BaseFeeMaxChangeDenominator => _spec.BaseFeeMaxChangeDenominator; public long ElasticityMultiplier => _spec.ElasticityMultiplier; diff --git a/src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainParameters.cs b/src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainParameters.cs index d4b7ec77e07..dee08eea1aa 100644 --- a/src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainParameters.cs +++ b/src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainParameters.cs @@ -116,7 +116,6 @@ public class ChainParameters public ulong? Eip5656TransitionTimestamp { get; set; } public ulong? Eip6780TransitionTimestamp { get; set; } public ulong? Eip4788TransitionTimestamp { get; set; } - public ulong? Eip3074TransitionTimestamp { get; set; } public Address Eip4788ContractAddress { get; set; } public ulong? Eip6110TransitionTimestamp { get; set; } public Address DepositContractAddress { get; set; } diff --git a/src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecBasedSpecProvider.cs b/src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecBasedSpecProvider.cs index 0cf3e1e8407..49d9383ed23 100644 --- a/src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecBasedSpecProvider.cs +++ b/src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecBasedSpecProvider.cs @@ -251,7 +251,6 @@ private static ReleaseSpec CreateReleaseSpec(ChainSpec chainSpec, long releaseSt releaseSpec.IsEip5656Enabled = (chainSpec.Parameters.Eip5656TransitionTimestamp ?? ulong.MaxValue) <= releaseStartTimestamp; releaseSpec.IsEip6780Enabled = (chainSpec.Parameters.Eip6780TransitionTimestamp ?? ulong.MaxValue) <= releaseStartTimestamp; releaseSpec.IsEip4788Enabled = (chainSpec.Parameters.Eip4788TransitionTimestamp ?? ulong.MaxValue) <= releaseStartTimestamp; - releaseSpec.IsEip3074Enabled = (chainSpec.Parameters.Eip3074TransitionTimestamp ?? ulong.MaxValue) <= releaseStartTimestamp; releaseSpec.Eip4788ContractAddress = chainSpec.Parameters.Eip4788ContractAddress; releaseSpec.AuRaSystemCalls = chainSpec.SealEngineType == SealEngineType.AuRa; releaseSpec.IsEip2935Enabled = (chainSpec.Parameters.Eip2935TransitionTimestamp ?? ulong.MaxValue) <= releaseStartTimestamp; diff --git a/src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecLoader.cs b/src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecLoader.cs index 15d8593469c..a7274d9319c 100644 --- a/src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecLoader.cs +++ b/src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecLoader.cs @@ -144,7 +144,6 @@ bool GetForInnerPathExistence(KeyValuePair o) => Eip6780TransitionTimestamp = chainSpecJson.Params.Eip6780TransitionTimestamp, Rip7212TransitionTimestamp = chainSpecJson.Params.Rip7212TransitionTimestamp, Eip4788TransitionTimestamp = chainSpecJson.Params.Eip4788TransitionTimestamp, - Eip3074TransitionTimestamp = chainSpecJson.Params.Eip3074TransitionTimestamp, Eip4788ContractAddress = chainSpecJson.Params.Eip4788ContractAddress ?? Eip4788Constants.BeaconRootsAddress, Eip2935TransitionTimestamp = chainSpecJson.Params.Eip2935TransitionTimestamp, Eip2935ContractAddress = chainSpecJson.Params.Eip2935ContractAddress ?? Eip2935Constants.BlockHashHistoryAddress, diff --git a/src/Nethermind/Nethermind.Specs/ChainSpecStyle/Json/ChainSpecParamsJson.cs b/src/Nethermind/Nethermind.Specs/ChainSpecStyle/Json/ChainSpecParamsJson.cs index 60fc188ee33..7c9a61f267a 100644 --- a/src/Nethermind/Nethermind.Specs/ChainSpecStyle/Json/ChainSpecParamsJson.cs +++ b/src/Nethermind/Nethermind.Specs/ChainSpecStyle/Json/ChainSpecParamsJson.cs @@ -140,7 +140,6 @@ internal class ChainSpecParamsJson public ulong? Eip5656TransitionTimestamp { get; set; } public ulong? Eip6780TransitionTimestamp { get; set; } public ulong? Eip4788TransitionTimestamp { get; set; } - public ulong? Eip3074TransitionTimestamp { get; set; } public Address Eip4788ContractAddress { get; set; } public ulong? Eip2935TransitionTimestamp { get; set; } public Address Eip2935ContractAddress { get; set; } diff --git a/src/Nethermind/Nethermind.Specs/Forks/18_Prague.cs b/src/Nethermind/Nethermind.Specs/Forks/18_Prague.cs index 11e8bed2c21..d88d482ea47 100644 --- a/src/Nethermind/Nethermind.Specs/Forks/18_Prague.cs +++ b/src/Nethermind/Nethermind.Specs/Forks/18_Prague.cs @@ -16,7 +16,6 @@ protected Prague() Name = "Prague"; IsEip2537Enabled = true; IsEip2935Enabled = true; - IsEip3074Enabled = true; IsEip6110Enabled = true; IsEip7002Enabled = true; IsRip7212Enabled = true; diff --git a/src/Nethermind/Nethermind.Specs/ReleaseSpec.cs b/src/Nethermind/Nethermind.Specs/ReleaseSpec.cs index 9d418c07f18..221d171b762 100644 --- a/src/Nethermind/Nethermind.Specs/ReleaseSpec.cs +++ b/src/Nethermind/Nethermind.Specs/ReleaseSpec.cs @@ -87,7 +87,6 @@ public ReleaseSpec Clone() public bool IsEip4788Enabled { get; set; } public bool IsEip7002Enabled { get; set; } public Address Eip7002ContractAddress { get; set; } - public bool IsEip3074Enabled { get; set; } private Address _eip4788ContractAddress; public Address Eip4788ContractAddress diff --git a/src/Nethermind/Nethermind.Specs/SystemTransactionReleaseSpec.cs b/src/Nethermind/Nethermind.Specs/SystemTransactionReleaseSpec.cs index b854b92918f..a26c72aecb2 100644 --- a/src/Nethermind/Nethermind.Specs/SystemTransactionReleaseSpec.cs +++ b/src/Nethermind/Nethermind.Specs/SystemTransactionReleaseSpec.cs @@ -124,7 +124,6 @@ public bool IsEip158IgnoredAccount(Address address) public bool IsEip5656Enabled => _spec.IsEip5656Enabled; public bool IsEip6780Enabled => _spec.IsEip6780Enabled; public bool IsEip4788Enabled => _spec.IsEip4788Enabled; - public bool IsEip3074Enabled => _spec.IsEip3074Enabled; public Address Eip4788ContractAddress => _spec.Eip4788ContractAddress; public bool AuRaSystemCalls => false;