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

Add syncArchiversList in the sync-v2 #5

Merged
merged 2 commits into from
Apr 23, 2024
Merged

Add syncArchiversList in the sync-v2 #5

merged 2 commits into from
Apr 23, 2024

Conversation

jairajdev
Copy link
Contributor

https://linear.app/shm/issue/BLUE-8/add-syncarchiverslist-in-the-sync-v2-archiver
Summary:

Add syncArchiversList in the sync-v2 (archiver)
Sync active archivers list in the network as a part of syncV2.

@jairajdev jairajdev self-assigned this Apr 22, 2024
Copy link

linear bot commented Apr 22, 2024

BLUE-8 Add syncArchiversList in the sync-v2 (archiver)

The syncV2 in Archiver is missing the syncArchiversList.
https://gitlab.com/shardus/archive/archive-server/-/blob/eb92f000709f7ff0681510be3328501966e46939/src/sync-v2/index.ts#L50

Reference: syncV2 process in shardus core.
https://gitlab.com/shardus/global/shardus-global-server/-/blob/bb853f3381da9dde2a5c235b064a80c6fdaa5a91/src/p2p/SyncV2/index.ts#L47

The archiver should also sync the current active archivers list in the network as a part of syncV2. If not the archiver can miss some archiver info and will lead to issues in gossip data between archivers.

export function addArchiver(archiver: ArchiverNodeInfo): void {
const foundArchiver = activeArchivers.find((a) => a.publicKey === archiver.publicKey)
if (!foundArchiver) {
Logger.mainLogger.debug('Adding archiver', archiver)

Check warning

Code scanning / CodeQL

Log injection Medium

Log entry depends on a
user-provided value
.
Utils.insertSorted(activeArchiversByPublicKeySorted, archiver, NodeList.byAscendingPublicKey)
Logger.mainLogger.debug(
'activeArchiversByPublicKeySorted',
activeArchiversByPublicKeySorted.map((archiver) => archiver.publicKey)

Check warning

Code scanning / CodeQL

Log injection Medium

Log entry depends on a
user-provided value
.
'activeArchiversByPublicKeySorted',
activeArchiversByPublicKeySorted.map((archiver) => archiver.publicKey)
)
Logger.mainLogger.debug('New archiver added to active list', archiver)

Check warning

Code scanning / CodeQL

Log injection Medium

Log entry depends on a
user-provided value
.
)
Logger.mainLogger.debug('New archiver added to active list', archiver)
}
Logger.mainLogger.debug('archivers list', activeArchivers)

Check warning

Code scanning / CodeQL

Log injection Medium

Log entry depends on a
user-provided value
.
@jairajdev jairajdev merged commit 1b27987 into dev Apr 23, 2024
2 checks passed
@jairajdev jairajdev deleted the BLUE-8 branch April 23, 2024 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants