Skip to content

Commit

Permalink
Add EIP-4895 check to withdrawal application
Browse files Browse the repository at this point in the history
  • Loading branch information
rubo committed Oct 18, 2022
1 parent c227c0e commit 2539d2f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ private void ApplyDaoTransition(Block block)

private void ApplyWithdrawals(Block block, IReleaseSpec spec)
{
if (!spec.IsEip4895Enabled)
return;

if (_logger.IsTrace) _logger.Trace($"Applying withdrawals");

foreach (var withdrawal in block.Withdrawals)
Expand Down
7 changes: 7 additions & 0 deletions src/Nethermind/Nethermind.Core/Specs/IReleaseSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,13 @@ public interface IReleaseSpec
/// </summary>
bool IsEip1153Enabled { get; }

/// <summary>
/// Gets or sets a value indicating whether the
/// <see href="https://eips.ethereum.org/EIPS/eip-4895">EIP-4895</see>
/// validator withdrawals are enabled.
/// </summary>
bool IsEip4895Enabled { get; }

/// <summary>
/// Should transactions be validated against chainId.
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions src/Nethermind/Nethermind.Specs/ReleaseSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,6 @@ public class ReleaseSpec : IReleaseSpec
public bool IsEip1153Enabled { get; set; }
public bool IsEip3675Enabled { get; set; }
public bool IsEip3651Enabled { get; set; }
public bool IsEip4895Enabled { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,6 @@ public bool IsEip158IgnoredAccount(Address address)
public bool IsEip1153Enabled => _spec.IsEip1153Enabled;
public bool IsEip3675Enabled => _spec.IsEip3675Enabled;
public bool IsEip3651Enabled => _spec.IsEip3651Enabled;
public bool IsEip4895Enabled => _spec.IsEip4895Enabled;
}
}

0 comments on commit 2539d2f

Please sign in to comment.