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

Optimize out DaoTransition call #7468

Merged
merged 1 commit into from
Sep 21, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -427,7 +428,14 @@ private void ApplyMinerReward(Block block, BlockReward reward, IReleaseSpec spec
// TODO: block processor pipeline
private void ApplyDaoTransition(Block block)
{
if (_specProvider.DaoBlockNumber.HasValue && _specProvider.DaoBlockNumber.Value == block.Header.Number)
long? daoBlockNumber = _specProvider.DaoBlockNumber;
if (daoBlockNumber.HasValue && daoBlockNumber.Value == block.Header.Number)
{
ApplyTransition();
}

[MethodImpl(MethodImplOptions.NoInlining)]
void ApplyTransition()
{
if (_logger.IsInfo) _logger.Info("Applying the DAO transition");
Address withdrawAccount = DaoData.DaoWithdrawalAccount;
Expand Down