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

Allow bh sync isntantly; use unsafe updater with taiko #7683

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,22 @@

namespace Nethermind.Merge.Plugin.Synchronization;

public class UnsafePivotUpdator(
IBlockTree blockTree,
ISyncModeSelector syncModeSelector,
ISyncPeerPool syncPeerPool,
ISyncConfig syncConfig,
IBlockCacheService blockCacheService,
IBeaconSyncStrategy beaconSyncStrategy,
IDb metadataDb,
ILogManager logManager)
: PivotUpdator(blockTree, syncModeSelector, syncPeerPool, syncConfig,
blockCacheService, beaconSyncStrategy, metadataDb, logManager)
public class UnsafePivotUpdator : PivotUpdator
{
public UnsafePivotUpdator(
IBlockTree blockTree,
ISyncModeSelector syncModeSelector,
ISyncPeerPool syncPeerPool,
ISyncConfig syncConfig,
IBlockCacheService blockCacheService,
IBeaconSyncStrategy beaconSyncStrategy,
IDb metadataDb,
ILogManager logManager) : base(blockTree, syncModeSelector, syncPeerPool, syncConfig,
blockCacheService, beaconSyncStrategy, metadataDb, logManager)
{
_beaconSyncStrategy.AllowBeaconHeaderSync();
Copy link
Contributor

Choose a reason for hiding this comment

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

UnsafePivotUpdator is used by optimism too and it is not expected to allow beacon headers sync from the very beginning there. Would be good to create second, non default constructor with additional flag or just add the flag. At the end - allow beacon heder sync from the beginning for taiko, don't allow for op

}

protected override async Task<(Hash256 Hash, long Number)?> TryGetPivotData(CancellationToken cancellationToken)
{
// getting potentially unsafe head block hash, because some chains (e.g. optimism) aren't providing finalized block hash until fully synced
Expand Down
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Taiko/TaikoPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public Task InitSynchronization()
_api.ApiWithNetworkServiceContainer = container;
_api.DisposeStack.Append(container);

PivotUpdator pivotUpdator = new(
UnsafePivotUpdator pivotUpdator = new(
_api.BlockTree,
_api.SyncModeSelector,
_api.SyncPeerPool,
Expand Down