-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove coupling from merge plugin and aura (#7044)
Co-authored-by: Ahmad Bitar <amb014@diyarme.com>
- Loading branch information
1 parent
ad86f41
commit e856de5
Showing
15 changed files
with
91 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...Ra/Withdrawals/NullWithdrawalProcessor.cs → ...us/Withdrawals/NullWithdrawalProcessor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
src/Nethermind/Nethermind.Merge.AuRa/AuRaMergeFinalizationManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited | ||
// SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
using System; | ||
using Nethermind.Blockchain; | ||
using Nethermind.Consensus; | ||
using Nethermind.Consensus.AuRa; | ||
using Nethermind.Consensus.Processing; | ||
using Nethermind.Core.Crypto; | ||
|
||
namespace Nethermind.Merge.Plugin; | ||
|
||
public class AuRaMergeFinalizationManager : MergeFinalizationManager, IAuRaBlockFinalizationManager | ||
{ | ||
private readonly IAuRaBlockFinalizationManager _auRaBlockFinalizationManager; | ||
|
||
public AuRaMergeFinalizationManager(IManualBlockFinalizationManager manualBlockFinalizationManager, IAuRaBlockFinalizationManager blockFinalizationManager, IPoSSwitcher poSSwitcher) | ||
: base(manualBlockFinalizationManager, blockFinalizationManager, poSSwitcher) | ||
{ | ||
_auRaBlockFinalizationManager = blockFinalizationManager; | ||
_auRaBlockFinalizationManager.BlocksFinalized += OnBlockFinalized; | ||
} | ||
|
||
public long GetLastLevelFinalizedBy(Hash256 blockHash) | ||
{ | ||
return _auRaBlockFinalizationManager.GetLastLevelFinalizedBy(blockHash); | ||
} | ||
|
||
public long? GetFinalizationLevel(long level) | ||
{ | ||
return _auRaBlockFinalizationManager.GetFinalizationLevel(level); | ||
} | ||
|
||
public void SetMainBlockProcessor(IBlockProcessor blockProcessor) | ||
{ | ||
_auRaBlockFinalizationManager.SetMainBlockProcessor(blockProcessor); | ||
} | ||
|
||
public override long LastFinalizedBlockLevel | ||
{ | ||
get | ||
{ | ||
return IsPostMerge | ||
? _manualBlockFinalizationManager.LastFinalizedBlockLevel | ||
: _auRaBlockFinalizationManager.LastFinalizedBlockLevel; | ||
} | ||
} | ||
|
||
public override void Dispose() | ||
{ | ||
if (IsPostMerge) | ||
{ | ||
_auRaBlockFinalizationManager.Dispose(); | ||
} | ||
base.Dispose(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters