-
Notifications
You must be signed in to change notification settings - Fork 715
fixed broadcasting AccountData after node restart. #8407
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
Conversation
if !self.is_n 10000 ew(&d) { | ||
return None; | ||
} | ||
let d = match &self.local { | ||
Some(local) if d.account_key == local.signer.public_key() => Arc::new( | ||
VersionedAccountData { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we do it only if account data differs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could, but we don't care. If we encounter anything that we don't know that we have signed, we override it. It is a form of defense in depth - especially since the underlying proto may contain extra information that we cannot interpret (the received data might have been signed by a different neard version).
This is a roll forward of #8182 , which was reverted by #8314 . The issue that #8182 caused has been fixed in #8407 . nayduck run: https://nayduck.near.org/#/run/2834 before the fix tests/sanity/switch_node_key.py was failing, now it succeeds. No nayduck tests are newly failing with this PR, compared to master.
AccountData is broadcasted by validator node periodically (every 15min). AccountData with greatest `version` field is considered the freshest. We do not store the latest broadcasted version in storage, so each time node is restarted, is starts with version = 1, unless it learns the latest broadcasted version (from the previous execution) from the network. It means that it may happen that the correct AccountData will be broadcasted only after 15min from restart. This in turn means that the validator might be not reachable (messages cannot be routed to it) for 15min which is unacceptable. We fix that by making the validator node broadcast a new version of AccountData as soon as it learns about stale AccountData (but with higher version) from the network. Alternative solutions considered are described in the accounts_data/mod.rs (see documentation of is_new() function).
This is a roll forward of near#8182 , which was reverted by near#8314 . The issue that near#8182 caused has been fixed in near#8407 . nayduck run: https://nayduck.near.org/#/run/2834 before the fix tests/sanity/switch_node_key.py was failing, now it succeeds. No nayduck tests are newly failing with this PR, 8000 compared to master.
AccountData is broadcasted by validator node periodically (every 15min). AccountData with greatest `version` field is considered the freshest. We do not store the latest broadcasted version in storage, so each time node is restarted, is starts with version = 1, unless it learns the latest broadcasted version (from the previous execution) from the network. It means that it may happen that the correct AccountData will be broadcasted only after 15min from restart. This in turn means that the validator might be not reachable (messages cannot be routed to it) for 15min which is unacceptable. We fix that by making the validator node broadcast a new version of AccountData as soon as it learns about stale AccountData (but with higher version) from the network. Alternative solutions considered are described in the accounts_data/mod.rs (see documentation of is_new() function).
This is a roll forward of near#8182 , which was reverted by near#8314 . The issue that near#8182 caused has been fixed in near#8407 . nayduck run: https://nayduck.near.org/#/run/2834 before the fix tests/sanity/switch_node_key.py was failing, now it succeeds. No nayduck tests are newly failing with this PR, compared to master.
AccountData is broadcasted by validator node periodically (every 15min). AccountData with greatest `version` field is considered the freshest. We do not store the latest broadcasted version in storage, so each time node is restarted, is starts with version = 1, unless it learns the latest broadcasted version (from the previous execution) from the network. It means that it may happen that the correct AccountData will be broadcasted only after 15min from restart. This in turn means that the validator might be not reachable (messages cannot be routed to it) for 15min which is unacceptable. We fix that by making the validator node broadcast a new version of AccountData as soon as it learns about stale AccountData (but with higher version) from the network. Alternative solutions considered are described in the accounts_data/mod.rs (see documentation of is_new() function).
This is a roll forward of near#8182 , which was reverted by near#8314 . The issue that near#8182 caused has been fixed in near#8407 . nayduck run: https://nayduck.near.org/#/run/2834 before the fix tests/sanity/switch_node_key.py was failing, now it succeeds. No nayduck tests are newly failing with this PR, compared to master.
AccountData is broadcasted by validator node periodically (every 15min).
AccountData with greatest
version
field is considered the freshest.We do not store the latest broadcasted version in storage, so each time node is restarted, is starts with version = 1, unless it learns the latest broadcasted version (from the previous execution) from the network.
It means that it may happen that the correct AccountData will be broadcasted only after 15min from restart.
This in turn means that the validator might be not reachable (messages cannot be routed to it) for 15min which is unacceptable. We fix that by making the validator node broadcast a new version of AccountData as soon as it learns about stale AccountData (but with higher version) from the network.
Alternative solutions considered are described in the accounts_data/mod.rs (see documentation of is_new() function).