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

Taiko #7326

Draft
wants to merge 78 commits into
base: master
Choose a base branch
from
Draft

Taiko #7326

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
b1f94c4
create taiko plugin
jmederosalvarado Jun 27, 2024
95b9b3b
Add IsAnchor field to tx
jmederosalvarado Jun 27, 2024
af47ff0
State transition
jmederosalvarado Jun 27, 2024
0653775
Gigachain L1Origin store and decoding (#7227)
jmederosalvarado Jun 27, 2024
5b38012
Gigachain engine api (#7230)
jmederosalvarado Jun 28, 2024
1772ab0
Add executor that ignores invalid txs in block
jmederosalvarado Jun 28, 2024
f5fd0a9
Consider cases where tx execution fails with exception
jmederosalvarado Jun 28, 2024
91ffe05
Add RPC (#7225)
flcl42 Jun 28, 2024
a957a00
Skip blob transactions during execution
jmederosalvarado Jun 28, 2024
3f62aed
Merge branch 'gigachain' of https:/nethermindeth/nethermi…
jmederosalvarado Jun 28, 2024
3d6c5fe
Some setup
jmederosalvarado Jun 28, 2024
290f5cf
Engine payload building
jmederosalvarado Jul 1, 2024
ef709e8
Anchor tx validation
jmederosalvarado Jul 1, 2024
4aa3968
Improve RPC (#7231)
flcl42 Jul 2, 2024
eb21b2a
don't require block producer env factory
jmederosalvarado Jul 2, 2024
1a0f156
Fix genesis, cfgs
flcl42 Jul 2, 2024
bc4ac88
engine fixes
jmederosalvarado Jul 2, 2024
1beb144
chainspec seal engine stuff
jmederosalvarado Jul 2, 2024
5ace420
Fix initialization
jmederosalvarado Jul 2, 2024
92cc9a1
general fixes
jmederosalvarado Jul 2, 2024
1686792
fixes in blockv alidator
jmederosalvarado Jul 2, 2024
a22c9d9
Recover sender address in block validator
jmederosalvarado Jul 3, 2024
75e2fb3
fix config
jmederosalvarado Jul 3, 2024
a494261
Fix configs
flcl42 Jul 3, 2024
aee598d
tx processing changes
jmederosalvarado Jul 3, 2024
db5df5a
override chainspec fee collector
jmederosalvarado Jul 3, 2024
cb9e0d9
Create anchor acc
flcl42 Jul 4, 2024
a03156e
Imrpove RPC
flcl42 Jul 5, 2024
82b2998
Fix encoding
flcl42 Jul 8, 2024
d294ed2
Add RLP decoder
flcl42 Jul 9, 2024
fbe4e40
Fix signing, tx list exclusion
flcl42 Jul 15, 2024
ed75032
Not readonly
flcl42 Jul 15, 2024
550bbd6
Enable beacon sync
flcl42 Jul 15, 2024
637b756
Reorg?
flcl42 Jul 15, 2024
26da2cf
Recover signature in better way
flcl42 Jul 17, 2024
9a7b9fc
Process when making tx lists
flcl42 Jul 19, 2024
b1b5d39
Clean up
flcl42 Jul 19, 2024
ba1e088
Simplify
flcl42 Jul 22, 2024
ef106a0
Correct tx lists
flcl42 Jul 26, 2024
4829df6
Fix format
flcl42 Jul 26, 2024
4dba636
Fix PreBuiltTxList json marshaling
flcl42 Jul 29, 2024
031b27d
Fix naming
flcl42 Jul 29, 2024
1590dbd
Merge branch 'master' into taiko
benaadams Aug 12, 2024
ab3bcc0
Delete taiko block producer related code
jmederosalvarado Aug 20, 2024
f33ed6c
Merge branch 'taiko' of https:/nethermindeth/nethermind i…
jmederosalvarado Aug 20, 2024
11113c1
Fix build
flcl42 Aug 20, 2024
2286f81
Add doc to `FailBlockProducer`
jmederosalvarado Aug 21, 2024
7b14a67
Fix static ctor on `NoBlockImprovementContextFactory`
jmederosalvarado Aug 21, 2024
d930c51
Update src/Nethermind/Nethermind.Taiko/TaikoBlockValidator.cs
jmederosalvarado Aug 21, 2024
45acde9
Update src/Nethermind/Nethermind.Taiko/TaikoBlockValidator.cs
jmederosalvarado Aug 21, 2024
56e0274
Simplify few things
jmederosalvarado Aug 21, 2024
26c0986
Revert "Update src/Nethermind/Nethermind.Taiko/TaikoBlockValidator.cs"
jmederosalvarado Aug 21, 2024
14a03b6
Revert "Update src/Nethermind/Nethermind.Taiko/TaikoBlockValidator.cs"
jmederosalvarado Aug 21, 2024
01dadcc
Add license headers
flcl42 Sep 12, 2024
1e5a611
Clean up base64 converter
flcl42 Sep 13, 2024
3eb14f2
Merge remote-tracking branch 'origin/master' into taiko
flcl42 Sep 13, 2024
288630e
Make block metadata .net-required
flcl42 Sep 13, 2024
e7a6509
Improve configs and L1 origin
flcl42 Sep 16, 2024
e16d591
Simplify and speed up getting tx pool content, but made it 99% effici…
flcl42 Sep 17, 2024
fa0609c
Update src/Nethermind/Nethermind.Taiko/TaikoBlockValidator.cs
flcl42 Sep 18, 2024
1ec3162
More clean up; improve ReleaseSpecDecorator
flcl42 Sep 18, 2024
48fb4a2
Merge branch 'taiko' of https:/NethermindEth/nethermind i…
flcl42 Sep 18, 2024
d25816c
Update src/Nethermind/Nethermind.Taiko/BlockInvalidTxExecutor.cs
flcl42 Sep 19, 2024
67522fe
Seprate FCU taiko logic; simplify configs
flcl42 Sep 19, 2024
e0a79e5
Merge remote-tracking branch 'origin/master' into taiko
flcl42 Sep 20, 2024
21e68b2
More cleanup
flcl42 Sep 20, 2024
e6c0363
Merge remote-tracking branch 'origin/master' into taiko
flcl42 Sep 24, 2024
b07fd57
Ontake wip
flcl42 Oct 2, 2024
84de80a
Merge master into taiko
flcl42 Oct 3, 2024
1762e32
Add Ontake; clean up
flcl42 Oct 4, 2024
ae19ec4
Remove lock; clean up
flcl42 Oct 7, 2024
3db87e4
Merge master into taiko
flcl42 Oct 7, 2024
946e8cd
Fix compilation
flcl42 Oct 10, 2024
60f434e
Clean up
flcl42 Oct 10, 2024
f30c9f2
Fixes
flcl42 Oct 11, 2024
90a4c8f
Some small improvements
flcl42 Oct 11, 2024
27fe295
Fix tests
flcl42 Oct 11, 2024
efb52ca
Merge master into taiko
flcl42 Oct 11, 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
292 changes: 292 additions & 0 deletions src/Nethermind/Chains/taiko-hekla.json

Large diffs are not rendered by default.

277 changes: 277 additions & 0 deletions src/Nethermind/Chains/taiko-mainnet.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Api/Extensions/PluginConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ namespace Nethermind.Api.Extensions;

public class PluginConfig : IPluginConfig
{
public string[] PluginOrder { get; set; } = { "Clique", "Aura", "Ethash", "Optimism", "Shutter", "AuRaMerge", "Merge", "MEV", "HealthChecks", "Hive" };
public string[] PluginOrder { get; set; } = { "Clique", "Aura", "Ethash", "Optimism", "Shutter", "Taiko", "AuRaMerge", "Merge", "MEV", "HealthChecks", "Hive" };
}
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Consensus/AlwaysPoS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ private AlwaysPoS() { }

public UInt256? TerminalTotalDifficulty => 0;

public UInt256? FinalTotalDifficulty => null;
flcl42 marked this conversation as resolved.
Show resolved Hide resolved
public UInt256? FinalTotalDifficulty => 0;

public bool TransitionFinished => true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@

namespace Nethermind.Consensus.Processing
{
internal static class BlockExtensions
public static class BlockExtensions
{
public static Block CreateCopy(this Block block, BlockHeader header) =>
block is BlockToProduce blockToProduce
? new BlockToProduce(header, blockToProduce.Transactions, blockToProduce.Uncles, blockToProduce.Withdrawals, blockToProduce.Requests)
: new Block(header, block.Transactions, block.Uncles, block.Withdrawals, block.Requests);

public static IEnumerable<Transaction> GetTransactions(this Block block) =>
block is BlockToProduce blockToProduce
? blockToProduce.Transactions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ private Block PrepareBlockForProcessing(Block suggestedBlock)
headerForProcessing.StateRoot = bh.StateRoot;
}

return suggestedBlock.CreateCopy(headerForProcessing);
return suggestedBlock.WithReplacedHeader(headerForProcessing);
}

// TODO: block processor pipeline
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using Nethermind.Evm.TransactionProcessing;

namespace Nethermind.Consensus.Processing;

public interface IReadOnlyTxProcessingEnvFactory
{
public IReadOnlyTxProcessorSource Create();
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using Nethermind.Blockchain;
using Nethermind.Core.Specs;
using Nethermind.Evm.TransactionProcessing;
using Nethermind.Logging;
using Nethermind.State;

Expand All @@ -13,7 +14,7 @@ public class ReadOnlyTxProcessingEnvFactory(
IReadOnlyBlockTree readOnlyBlockTree,
ISpecProvider? specProvider,
ILogManager? logManager,
IWorldState? worldStateToWarmUp = null)
IWorldState? worldStateToWarmUp = null) : IReadOnlyTxProcessingEnvFactory
{
public ReadOnlyTxProcessingEnvFactory(
IWorldStateManager worldStateManager,
Expand All @@ -25,5 +26,5 @@ public ReadOnlyTxProcessingEnvFactory(
{
}

public ReadOnlyTxProcessingEnv Create() => new(worldStateManager, readOnlyBlockTree, specProvider, logManager, worldStateToWarmUp);
public IReadOnlyTxProcessorSource Create() => new ReadOnlyTxProcessingEnv(worldStateManager, readOnlyBlockTree, specProvider, logManager, worldStateToWarmUp);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ public BlockProductionPolicy(
public bool ShouldStartBlockProduction() => _miningConfig.Enabled;
}

public class NeverStartBlockProductionPolicy : IBlockProductionPolicy
{
public bool ShouldStartBlockProduction() => false;

public static NeverStartBlockProductionPolicy Instance =>
LazyInitializer.EnsureInitialized(ref _instance, () => new());

private static NeverStartBlockProductionPolicy? _instance;
private NeverStartBlockProductionPolicy() { }
}

public class AlwaysStartBlockProductionPolicy : IBlockProductionPolicy
{
public bool ShouldStartBlockProduction() => true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Nethermind.Consensus.Producers
{
internal class BlockToProduce : Block
public class BlockToProduce : Block
{
private IEnumerable<Transaction>? _transactions;

Expand All @@ -39,5 +39,7 @@ public BlockToProduce(BlockHeader blockHeader,
{
Transactions = transactions;
}

public override Block WithReplacedHeader(BlockHeader newHeader) => new BlockToProduce(newHeader, Transactions, Uncles, Withdrawals, Requests);
}
}
23 changes: 23 additions & 0 deletions src/Nethermind/Nethermind.Consensus/Producers/FailBlockProducer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using Nethermind.Core;
using Nethermind.Evm.Tracing;

namespace Nethermind.Consensus.Producers;

/// <summary>
/// A BlockProducer that always fails.
/// It is used in tests or when the node is not supposed to produce blocks, and we want to detect block production being triggered.
/// </summary>
public class FailBlockProducer : IBlockProducer
{
public Task<Block?> BuildBlock(
BlockHeader? parentHeader = null,
IBlockTracer? blockTracer = null,
PayloadAttributes? payloadAttributes = null,
CancellationToken? cancellationToken = null)
{
throw new InvalidOperationException("FailBlockProducer is not supposed to produce blocks.");
flcl42 marked this conversation as resolved.
Show resolved Hide resolved
}
}
2 changes: 0 additions & 2 deletions src/Nethermind/Nethermind.Consensus/Transactions/ITxSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ public interface ITxSource
{
IEnumerable<Transaction> GetTransactions(BlockHeader parent, long gasLimit, PayloadAttributes? payloadAttributes = null);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ public static bool ValidateRequestsOrder(Block block, out string? error)
return true;
}

private bool ValidateTransactions(Block block, IReleaseSpec spec, out string? errorMessage)
protected virtual bool ValidateTransactions(Block block, IReleaseSpec spec, out string? errorMessage)
{
Transaction[] transactions = block.Transactions;

Expand All @@ -362,7 +362,7 @@ private bool ValidateTransactions(Block block, IReleaseSpec spec, out string? er
return true;
}

private bool ValidateEip4844Fields(Block block, IReleaseSpec spec, out string? error)
protected virtual bool ValidateEip4844Fields(Block block, IReleaseSpec spec, out string? error)
{
if (!spec.IsEip4844Enabled)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public virtual bool Validate(BlockHeader header, BlockHeader? parent, bool isUnc
&& ValidateBlobGasFields(header, parent, spec, ref error);
}

private bool Validate1559(BlockHeader header, BlockHeader parent, IReleaseSpec spec, ref string? error)
protected virtual bool Validate1559(BlockHeader header, BlockHeader parent, IReleaseSpec spec, ref string? error)
{
if (spec.IsEip1559Enabled)
{
Expand All @@ -112,7 +112,7 @@ private bool Validate1559(BlockHeader header, BlockHeader parent, IReleaseSpec s
return true;
}

private bool ValidateBlockNumber(BlockHeader header, BlockHeader parent, ref string? error)
protected virtual bool ValidateBlockNumber(BlockHeader header, BlockHeader parent, ref string? error)
{
if (header.Number != parent.Number + 1)
{
Expand All @@ -124,7 +124,7 @@ private bool ValidateBlockNumber(BlockHeader header, BlockHeader parent, ref str
return true;
}

private bool ValidateGasUsed(BlockHeader header, ref string? error)
protected virtual bool ValidateGasUsed(BlockHeader header, ref string? error)
{
if (header.GasUsed > header.GasLimit)
{
Expand All @@ -136,7 +136,7 @@ private bool ValidateGasUsed(BlockHeader header, ref string? error)
return true;
}

private bool ValidateParent(BlockHeader header, BlockHeader? parent, ref string? error)
protected virtual bool ValidateParent(BlockHeader header, BlockHeader? parent, ref string? error)
{
if (parent is null)
{
Expand All @@ -159,7 +159,7 @@ private bool ValidateParent(BlockHeader header, BlockHeader? parent, ref string?
return true;
}

private bool ValidateSeal(BlockHeader header, BlockHeader parent, bool isUncle, ref string? error)
protected virtual bool ValidateSeal(BlockHeader header, BlockHeader parent, bool isUncle, ref string? error)
{
bool result = _sealValidator.ValidateParams(parent, header, isUncle);

Expand All @@ -172,7 +172,7 @@ private bool ValidateSeal(BlockHeader header, BlockHeader parent, bool isUncle,
return result;
}

private bool ValidateFieldLimit(BlockHeader blockHeader, ref string? error)
protected virtual bool ValidateFieldLimit(BlockHeader blockHeader, ref string? error)
{
// Note, these are out of spec. Technically, there could be a block with field with very high value that is
// valid when using ulong, but wrapped to negative value when using long. However, switching to ulong
Expand Down Expand Up @@ -248,7 +248,7 @@ protected virtual bool ValidateGasLimitRange(BlockHeader header, BlockHeader par
return gasLimitNotTooHigh && gasLimitNotTooLow;
}

private bool ValidateTimestamp(BlockHeader header, BlockHeader parent, ref string? error)
protected virtual bool ValidateTimestamp(BlockHeader header, BlockHeader parent, ref string? error)
{
bool timestampMoreThanAtParent = header.Timestamp > parent.Timestamp;
if (!timestampMoreThanAtParent)
Expand Down Expand Up @@ -312,7 +312,7 @@ private bool ValidateGenesis(BlockHeader header) =>
header.Bloom is not null &&
header.ExtraData.Length <= _specProvider.GenesisSpec.MaximumExtraDataSize;

private bool ValidateBlobGasFields(BlockHeader header, BlockHeader parentHeader, IReleaseSpec spec, ref string? error)
protected virtual bool ValidateBlobGasFields(BlockHeader header, BlockHeader parentHeader, IReleaseSpec spec, ref string? error)
{
if (spec.IsEip4844Enabled)
{
Expand Down
30 changes: 30 additions & 0 deletions src/Nethermind/Nethermind.Core.Test/Json/Base64ConverterTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using Nethermind.Serialization.Json;
using NUnit.Framework;
using System.Linq;

namespace Nethermind.Core.Test.Json;

[TestFixture]
public class Base64ConverterTests : ConverterTestBase<byte[]?>
{
[TestCase(null)]
[TestCase(new byte[0])]
[TestCase(new byte[] { 1 })]
[TestCase(new byte[] { 0, 1 })]
[TestCase(new byte[] { 0, 0, 1 })]
[TestCase(new byte[] { 0, 0, 255 })]
[TestCase(new byte[] { 0, 0, 1, 0 })]
[TestCase(new byte[] { 0, 0, 1, 0, 0 })]
[TestCase(new byte[] { 0, 0, 1, 0, 127 })]
[TestCase(new byte[] { 0, 0, 1, 0, 255 })]
public void ValueWithAndWithoutLeadingZeros_are_equal(byte[]? value)
{
TestConverter(
value,
(before, after) => (before is null && after is null) || (before is not null && after is not null && before.SequenceEqual(after)),
new Base64Converter());
}
}
3 changes: 1 addition & 2 deletions src/Nethermind/Nethermind.Core/Block.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using Nethermind.Core.ConsensusRequests;
Expand Down Expand Up @@ -46,7 +45,7 @@ public Block(BlockHeader header) : this(
)
{ }

public Block WithReplacedHeader(BlockHeader newHeader) => new(newHeader, Body);
public virtual Block WithReplacedHeader(BlockHeader newHeader) => new(newHeader, Body);

public Block WithReplacedBody(BlockBody newBody) => new(Header, newBody);

Expand Down
1 change: 1 addition & 0 deletions src/Nethermind/Nethermind.Core/SealEngineType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ public static class SealEngineType
public const string Ethash = nameof(Ethash);
public const string BeaconChain = nameof(BeaconChain);
public const string Optimism = nameof(Optimism);
public const string Taiko = nameof(Taiko);
}
}
3 changes: 3 additions & 0 deletions src/Nethermind/Nethermind.Core/Specs/IReleaseSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ public interface IReleaseSpec : IEip1559Spec, IReceiptSpec
/// OP Granite
bool IsOpGraniteEnabled { get; }

/// Taiko Ontake
bool IsOntakeEnabled { get; }

/// <summary>
/// Should transactions be validated against chainId.
/// </summary>
Expand Down
46 changes: 46 additions & 0 deletions src/Nethermind/Nethermind.Core/Specs/ReleaseSpecDecorator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,54 @@ public class ReleaseSpecDecorator(IReleaseSpec spec) : IReleaseSpec
public bool IsEip7702Enabled => spec.IsEip7702Enabled;
public virtual bool IsRip7212Enabled => spec.IsRip7212Enabled;
public virtual bool IsOpGraniteEnabled => spec.IsOpGraniteEnabled;
public virtual bool IsOntakeEnabled => spec.IsOntakeEnabled;
public virtual ulong WithdrawalTimestamp => spec.WithdrawalTimestamp;
public virtual ulong Eip4844TransitionTimestamp => spec.Eip4844TransitionTimestamp;
public virtual bool IsEip158IgnoredAccount(Address address) => spec.IsEip158IgnoredAccount(address);
public bool IsEip4844FeeCollectorEnabled => spec.IsEip4844FeeCollectorEnabled;

public virtual long MaxInitCodeSize => spec.MaxInitCodeSize;
public virtual bool ValidateChainId => spec.ValidateChainId;
public virtual bool ClearEmptyAccountWhenTouched => spec.ClearEmptyAccountWhenTouched;
// VM
public virtual bool LimitCodeSize => spec.LimitCodeSize;
public virtual bool UseHotAndColdStorage => spec.UseHotAndColdStorage;
public virtual bool UseTxAccessLists => spec.UseTxAccessLists;
public virtual bool AddCoinbaseToTxAccessList => spec.AddCoinbaseToTxAccessList;
public virtual bool ModExpEnabled => spec.ModExpEnabled;
public virtual bool Bn128Enabled => spec.Bn128Enabled;
public virtual bool BlakeEnabled => spec.BlakeEnabled;
public virtual bool Bls381Enabled => spec.Bls381Enabled;
public virtual bool ChargeForTopLevelCreate => spec.ChargeForTopLevelCreate;
public virtual bool FailOnOutOfGasCodeDeposit => spec.FailOnOutOfGasCodeDeposit;
public virtual bool UseShanghaiDDosProtection => spec.UseShanghaiDDosProtection;
public virtual bool UseExpDDosProtection => spec.UseExpDDosProtection;
public virtual bool UseLargeStateDDosProtection => spec.UseLargeStateDDosProtection;
public virtual bool ReturnDataOpcodesEnabled => spec.ReturnDataOpcodesEnabled;
public virtual bool ChainIdOpcodeEnabled => spec.ChainIdOpcodeEnabled;
public virtual bool Create2OpcodeEnabled => spec.Create2OpcodeEnabled;
public virtual bool DelegateCallEnabled => spec.DelegateCallEnabled;
public virtual bool StaticCallEnabled => spec.StaticCallEnabled;
public virtual bool ShiftOpcodesEnabled => spec.ShiftOpcodesEnabled;
public virtual bool RevertOpcodeEnabled => spec.RevertOpcodeEnabled;
public virtual bool ExtCodeHashOpcodeEnabled => spec.ExtCodeHashOpcodeEnabled;
public virtual bool SelfBalanceOpcodeEnabled => spec.SelfBalanceOpcodeEnabled;
public virtual bool UseConstantinopleNetGasMetering => spec.UseConstantinopleNetGasMetering;
public virtual bool UseIstanbulNetGasMetering => spec.UseIstanbulNetGasMetering;
public virtual bool UseNetGasMetering => spec.UseNetGasMetering;
public virtual bool UseNetGasMeteringWithAStipendFix => spec.UseNetGasMeteringWithAStipendFix;
public virtual bool Use63Over64Rule => spec.Use63Over64Rule;
public virtual bool BaseFeeEnabled => spec.BaseFeeEnabled;
// EVM Related
public virtual bool IncludePush0Instruction => spec.IncludePush0Instruction;
public virtual bool TransientStorageEnabled => spec.TransientStorageEnabled;
public virtual bool WithdrawalsEnabled => spec.WithdrawalsEnabled;
public virtual bool SelfdestructOnlyOnSameTransaction => spec.SelfdestructOnlyOnSameTransaction;
public virtual bool IsBeaconBlockRootAvailable => spec.IsBeaconBlockRootAvailable;
public virtual bool IsBlockHashInStateAvailable => spec.IsBlockHashInStateAvailable;
public virtual bool MCopyIncluded => spec.MCopyIncluded;
public virtual bool BlobBaseFeeEnabled => spec.BlobBaseFeeEnabled;
public virtual Address? FeeCollector => spec.FeeCollector;
public virtual UInt256? Eip1559BaseFeeMinValue => spec.Eip1559BaseFeeMinValue;
public virtual bool ValidateReceipts => spec.ValidateReceipts;
}
3 changes: 3 additions & 0 deletions src/Nethermind/Nethermind.Core/Transaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public class Transaction
/// </summary>
public TxType Type { get; set; }

// Taiko Anchor transaction
public bool IsAnchorTx { get; set; }

// Optimism deposit transaction fields
// SourceHash uniquely identifies the source of the deposit
public Hash256? SourceHash { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ private static void UpdateMetrics(ExecutionOptions opts, UInt256 effectiveGasPri
/// <param name="opts">Options (Flags) to use for execution</param>
/// <param name="intrinsicGas">Calculated intrinsic gas</param>
/// <returns></returns>
protected TransactionResult ValidateStatic(
protected virtual TransactionResult ValidateStatic(
Transaction tx,
BlockHeader header,
IReleaseSpec spec,
Expand Down Expand Up @@ -357,7 +357,7 @@ protected virtual TransactionResult ValidateGas(Transaction tx, BlockHeader head
if (validate && tx.GasLimit > header.GasLimit - header.GasUsed)
{
TraceLogInvalidTx(tx, $"BLOCK_GAS_LIMIT_EXCEEDED {tx.GasLimit} > {header.GasLimit} - {header.GasUsed}");
return "block gas limit exceeded";
return TransactionResult.BlockGasLimitExceeded;
}

return TransactionResult.Ok;
Expand Down Expand Up @@ -782,5 +782,7 @@ public readonly struct TransactionResult(string? error)
public static implicit operator TransactionResult(string? error) => new(error);
public static implicit operator bool(TransactionResult result) => result.Success;
public override string ToString() => Error is not null ? $"Fail : {Error}" : "Success";

public const string BlockGasLimitExceeded = "block gas limit exceeded";
}
}
Loading
Loading