You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Motivation
When inspecting the performance of our web demos (namely
hosted-fungible) we noticed that an incoming transfer triggers 7 network
requests while only 3 (last ones) are about accepting an incoming
transfer (proposing a block that includes the incoming message).
After closer research, it was discovered that we make:
- `HandleChainInfoQuery` - first request to learn about the sender chain
tip
- `HandleChainInfoQuery` - second time we request via
`fetch_sent_certificate_hashes` with a specific `BlockRange` (after
checking the `info.requested_received_log`)
- `DownloadCertificates` - to download the certififcates (by hash)
- `DownloadCertificates` - unnecessary query with empty payload (this
was a bug).
- and finally three requests to propose the block.
## Proposal
This PR proposes an improvement of the situation – decreasing # of
requests from 7 to 5:
- `HandleChainInfoQuery` – to learn about the missing certificates for
block heights that we might be missing
- `DownloadCertificatesByHeights` – new endpoint that we use to download
certificates at specific block heights
- and finally three requests to propose a block.
I don't think we can get it any lower with the way `ChainClient` is
currently structured.
This also improves all calls to `query_certificates_from` which are now
making 1 network query instead of two.
## Test Plan
CI
## Release Plan
- Nothing to do / These changes follow the usual release cycle. **OR**
- These changes should be backported to the latest `devnet` branch, then
- be released in a new SDK,
- be released in a validator hotfix.
## Links
- [reviewer
checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
0 commit comments