Skip to content

Commit

Permalink
Override txs to make them nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
flcl42 committed Oct 24, 2024
1 parent 08582f6 commit d1ef1a5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public virtual bool TryGetBlock([NotNullWhen(true)] out Block? block, UInt256? t
}
}

private Transaction[]? _transactions = null;
protected Transaction[]? _transactions = null;

/// <summary>
/// Decodes and returns an array of <see cref="Transaction"/> from <see cref="Transactions"/>.
Expand Down
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Taiko/BlockInvalidTxExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public TxReceipt[] ProcessTransactions(Block block, ProcessingOptions processing
TransactionProcessed?.Invoke(this, new TxProcessedEventArgs(i, tx, receiptsTracer.LastReceipt));
correctTransactions.Add(tx);
}

block.TrySetTransactions([.. correctTransactions]);
return [.. receiptsTracer.TxReceipts];
}
Expand Down
12 changes: 12 additions & 0 deletions src/Nethermind/Nethermind.Taiko/TaikoExecutionPayload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ public class TaikoExecutionPayload : ExecutionPayload
public Hash256? WithdrawalsHash { get; set; } = null;
public Hash256? TxHash { get; set; } = null;


private byte[][]? _encodedTransactions;
public new byte[][]? Transactions
{
get { return _encodedTransactions; }
set
{
_encodedTransactions = value;
_transactions = null;
}
}

protected override int GetExecutionPayloadVersion() => this switch
{
{ BlobGasUsed: not null } or { ExcessBlobGas: not null } or { ParentBeaconBlockRoot: not null } => 3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class TaikoPayloadPreparationService(

private readonly ConcurrentDictionary<string, IBlockProductionContext> _payloadStorage = new();

public string StartPreparingPayload(BlockHeader parentHeader, PayloadAttributes payloadAttributes)
public string? StartPreparingPayload(BlockHeader parentHeader, PayloadAttributes payloadAttributes)
{
TaikoPayloadAttributes attrs = (payloadAttributes as TaikoPayloadAttributes)
?? throw new InvalidOperationException("Payload attributes have incorrect type. Expected TaikoPayloadAttributes.");
Expand Down

0 comments on commit d1ef1a5

Please sign in to comment.