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

ticket-1610 Fixed - Loop worker doesn't receive connected chains #1611

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
14 changes: 9 additions & 5 deletions agent/loop.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -746,10 +746,8 @@ export async function ensureHaveWorkers( opts ) {
"strPathHashG1": opts.imaState.strPathHashG1,
"strPathBlsVerify": opts.imaState.strPathBlsVerify,
"isEnabledMultiCall": opts.imaState.isEnabledMultiCall,

"bNoWaitSChainStarted": opts.imaState.bNoWaitSChainStarted,
"nMaxWaitSChainAttempts": opts.imaState.nMaxWaitSChainAttempts,

"nTransferBlockSizeM2S": opts.imaState.nTransferBlockSizeM2S,
"nTransferBlockSizeS2M": opts.imaState.nTransferBlockSizeS2M,
"nTransferBlockSizeS2S": opts.imaState.nTransferBlockSizeS2S,
Expand All @@ -768,7 +766,6 @@ export async function ensureHaveWorkers( opts ) {
"nBlockAgeS2S": opts.imaState.nBlockAgeS2S,

"nLoopPeriodSeconds": opts.imaState.nLoopPeriodSeconds,

"nNodeNumber": opts.imaState.nNodeNumber,
"nNodesCount": opts.imaState.nNodesCount,
"nTimeFrameSeconds": opts.imaState.nTimeFrameSeconds,
Expand All @@ -781,7 +778,6 @@ export async function ensureHaveWorkers( opts ) {
"joDepositBoxERC1155": null,
"joDepositBoxERC721WithMetadata": null,
"joLinker": null,

"isWithMetadata721": false,

"joTokenManagerETH": null,
Expand Down Expand Up @@ -841,7 +837,6 @@ export async function ensureHaveWorkers( opts ) {
while( ! aClient.logicalInitComplete ) {
if( log.verboseGet() >= log.verboseReversed().info )
log.write( "LOOP server is not inited yet...\n" );

await threadInfo.sleep( 1000 );
aClient.send( jo );
}
Expand All @@ -863,6 +858,15 @@ export async function ensureHaveWorkers( opts ) {
if( threadInfo.isMainThread() )
notifyCacheChangedSNB( eventData.detail.arrSChainsCached );
} );
// Force broadcast what we have in SNB right now because works above can start later than SNB
// is finished download connected chains quickly
if( log.verboseGet() >= log.verboseReversed().debug ) {
log.write(
cc.debug( "Loop module will do first initial broadcast of arrSChainsCached to its " ) +
cc.info( cntWorkers ) + cc.debug( " worker(s) in " ) +
threadInfo.threadDescription() + cc.debug( "..." ) + "\n" );
}
notifyCacheChangedSNB( skaleObserver.getLastCachedSChains() );
}

export async function runParallelLoops( opts ) {
Expand Down