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

Sync admin chain only when needed #2538

Merged
merged 2 commits into from
Oct 7, 2024
Merged

Conversation

afck
Copy link
Contributor

@afck afck commented Sep 25, 2024

Motivation

Currently the client synchronizes the admin chain in addition to the user's chain (or whatever chain is currently being used) in every call to find_received_certificates, to make sure we have all committees, even the ones that have been created by the admin chain but not handled yet by the other chain. That is wasteful.

Proposal

Synchronize the admin chain only when we encounter an incoming message from a future epoch.

Test Plan

No new features were added, and the admin chain change was just an optimization, where existing tests should catch any regressions.

Links

@afck afck force-pushed the admin-chain-sync branch from 7766520 to 4d75487 Compare October 7, 2024 15:38
@afck afck marked this pull request as ready for review October 7, 2024 16:46
@afck afck requested review from ma2bd, ndr-ds and christos-h October 7, 2024 16:46
@ma2bd ma2bd merged commit 6766b5d into linera-io:main Oct 7, 2024
5 checks passed
@afck afck deleted the admin-chain-sync branch October 8, 2024 07:47
afck added a commit to afck/linera-protocol that referenced this pull request Oct 16, 2024
* Sync admin chain only when needed

* Don't forget old committees after syncing the admin chain.
afck added a commit to afck/linera-protocol that referenced this pull request Oct 17, 2024
afck added a commit that referenced this pull request Oct 17, 2024
afck added a commit that referenced this pull request Oct 17, 2024
afck added a commit that referenced this pull request Oct 18, 2024
* Retry all gRPC requests, not just notification streams. (#2565)

* Retry on gRPC errors.

* Rename retry parameters.

* Refactor delegate_client, make all functions retry.

* Refactor client_delegate; make all methods retry.

* Fix missed rename.

* Address review comments.

* marshal → unmarshal; remove unused import

* FUT → Fut

* Update outdated comments and identifiers (#2448)

* Remove an obsolete comment.

* Update comments, identifiers related to message bundles.

* `linera-client`: relax unnecessary `Send` bound on `P` (#2450)

* Upgrade to 1.81.0; fix a few allow attributes (#2463)

* Upgrade to Rust 1.81.0

* Remove some clippy allow attributes.

* Minor cleanups in linera-core. (#2468)

* Add CommunicateAction::round.

* Improve doc comments in client.rs.

* Remove some unused functions and unnecessary code.

* Update comment to make clear that pending_block is an option.

* Simplify notification handling in client.rs (#2469)

* Simplify notification handling in client.rs

* Revert stricter check, since it fails in the tests.

* Remove pub; move trait bounds to where they are needed.

* Make synchronize_received_certificates_from_validator a method. (#2472)

* In the node service, don't unnecessarily call prepare_chain. (#2479)

* Add latency metrics for client functions. (#2508)

* Add latency metrics for client functions.

* Fix error messages: counter vs. histogram.

* Add struct NamedNode. (#2514)

* Add struct NamedNode.

* Move more functionality to NamedNode.

* Box block proposal to avoid stack overflows.

* Add missing large_futures check to linera-client.

* Remove LocalValidatorNode(Provider) and LocalNotificationStream (#2522)

* rename LocalNotificationStream into WebNotificationStream

* remove LocalValidatorNode(Provider)

* (nit) Rename NamedNode into RemoteNode (#2521)

* named_node -> remote_node

* NamedNode -> RemoteNode

* Move ChainState to a submodule and make it guard its own invariant. (#2523)

* Use synchronize_from_validators instead of duplicating it.

* Move client.rs → client/mod.rs

* Make ChainState guard its own invariant

* Add an error message for pending block at wrong height.

* Cleanup: Use convenience methods.

* Fix deadlock.

* Misc minor fixes. (#2539)

* Fix cargo machete error: remove unused dep.

* Fix grammar: first_nth → first_n

* Move attributes to after the comments.

* Remove redundant prepare_chain calls.

* Lock mutex in more client methods. (#2567)

* Lock mutex in more client methods.

* Make mutating ChainState methods pub(super).

* Don't keep the client mutex longer than necessary. (#2581)

* Sync admin chain only when needed (#2538)

* Sync admin chain only when needed

* Don't forget old committees after syncing the admin chain.

* Allow creating a ChainClient if the chain is already in the map. (#2597)

* Allow creating a ChainClient if the chain is already in the map.

* Add the storage-service feature to run the benchmark test in CI.

* Add TODO for #2600.

* Make the other benchmark test stable, too. Rename it.

* `linera-client`: add IndexedDB persistence backend for the wallet (#2420)

* `linera_client::persistent`: support async persistence

* `linera-client`: add IndexedDB persistence implementation

* `linera_client::persistent`: refactor `mutate` into extension traits so we can use `trait-variant`

* `linera-client`: remove `localStorage` support

* `linera_client::persistent::dirty`: use `derive_more`

* `linera-execution`: update deprecated `derive_more` syntax

* `linera-client`: see if failing to save some changes is problematic

* CI: use `cargo run` for the storage-service instead of building and running separately

* `linera-service`: save the wallet after creation

* `linera-client`: only build IndexedDB support on the Web

* `linera-client`: fix benchmarking build

* `linera-service`: fix `remote_net.rs`

* `linera-client`: clippy fixes

* Documentation tweaks

Co-authored-by: Andreas Fackler <afck@users.noreply.github.com>
Signed-off-by: James Kay <james.kay@linera.io>

* `linera-client`: apply suggestions from code review

* `linera_client::persistent::indexed_db`: simplify and generalize API

* `linera-client`: don't require that the user construct a `WalletState`

* `linera-base`: use the Web console for tracing output

* `linera-client`: add tracing and fix a dirtiness bug

* Cleanup

---------

Signed-off-by: James Kay <james.kay@linera.io>
Co-authored-by: Andreas Fackler <afck@users.noreply.github.com>

* Remove ChainClients map. (#2604)

* Remove ChainClients map.

* Remove some unnecessary generic arguments.

* Use Arc::clone explicitly.

* Move trait bounds to ValidatorNodeProvider itself.

* Move trait bounds to ValidatorNode itself.

* Move trait bounds to ClientContext itself.

* Reduce the number of initial chains. (#2626)

* Reduce the number of initial chains.

* Fix README tests; make 2 other chains by default.

* Fix test_end_to_end_benchmark.

* Fix CLI.md.

* Retry node service query on timeouts (#2640)

Treat `reqwest` timeout errors the same as errors reported through
GraphQL.

* Add an end-to-end test that doubles as a latency benchmark. (#2513)

* Add an end-to-end test that can be used as a latency benchmark.

* Make number of test iterations configurable via env variable.

* Reduce timeout to 1 second in total.

* Revert "Sync admin chain only when needed (#2538)"

This reverts commit 74cf731.

* Increase timeout in test_end_to_end_repeated_transfers.

* Refactor synchronized_received_certificates_from_validator (#2643)

* Refactor synchronized_received_certificates_from_validator

* s/handle_certificate/check_certificate

* RM Certificate from enum variants

* RM obsolete comment

* Return error on validator error

* Move RemoteNode to its own module; move try_query_certificates_from there. (#2623)

---------

Signed-off-by: James Kay <james.kay@linera.io>
Co-authored-by: James Kay <james.kay@linera.io>
Co-authored-by: Mathieu Baudet <1105398+ma2bd@users.noreply.github.com>
Co-authored-by: Janito Vaqueiro Ferreira Filho <janito.vff@linera.io>
Co-authored-by: deuszx <95355183+deuszx@users.noreply.github.com>
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