Skip to content

Network: enable DHT server mode only while consensus is established - #3038

Open
styppo wants to merge 1 commit into
albatrossfrom
styppo/dht-on-consensus
Open

Network: enable DHT server mode only while consensus is established#3038
styppo wants to merge 1 commit into
albatrossfrom
styppo/dht-on-consensus

Conversation

@styppo

@styppo styppo commented Nov 12, 2024

Copy link
Copy Markdown
Contributor

With #3014, we can only properly verify DHT records once we have the staking contract. Therefore, this PR defers the switch to DHT server mode to when consensus is established. The DHT switches back to client mode when consensus is lost.

}

async fn dht_set_mode(&self, _mode: DhtMode) {
// TODO implement

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Set an unimplemented!() here? Same for validate_message. Otherwise the caller has no idea this still needs an actual impl

output.send(result).ok();
}
NetworkAction::DhtSetMode { mode } => {
#[cfg(feature = "kad")]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Feature annotations support { } to encapsulate a block of code:

#[cfg(feature = "kad")]
{
    ...
}

@nibhar nibhar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nothing to add to @Eligioo comments. Otherwise looks good to me. Requesting changes on his behalf.

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.

3 participants