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

rpc-compat: remove Author from BlockForRpc #8146

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 0 additions & 3 deletions src/Nethermind/Nethermind.Facade/Eth/BlockForRpc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ protected BlockForRpc()
public BlockForRpc(Block block, bool includeFullTransactionData, ISpecProvider specProvider)
{
_isAuRaBlock = block.Header.AuRaSignature is not null;
Author = block.Author ?? block.Beneficiary;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to
Author = block.Author;

Then let [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] remove it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that better!

Difficulty = block.Difficulty;
ExtraData = block.ExtraData;
GasLimit = block.GasLimit;
Expand Down Expand Up @@ -89,8 +88,6 @@ public BlockForRpc(Block block, bool includeFullTransactionData, ISpecProvider s
RequestsHash = block.Header.RequestsHash;
}

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Address? Author { get; set; }
public UInt256 Difficulty { get; set; }
public byte[] ExtraData { get; set; }
public long GasLimit { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ private static void CheckMisssingAndSetTracedDefaults(SimulateBlockTracer simula
current.WithdrawalsRoot = processedBlock.WithdrawalsRoot ?? Keccak.EmptyTreeHash;
current.ExcessBlobGas = processedBlock.ExcessBlobGas ?? 0;
current.Withdrawals = processedBlock.Withdrawals ?? [];
current.Author = null;
}

private static void FinalizeStateAndBlock(IWorldState stateProvider, Block processedBlock, IReleaseSpec currentSpec, Block currentBlock, IBlockTree blockTree)
Expand Down
Loading