-
Notifications
You must be signed in to change notification settings - Fork 330
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
feat(nns): Avoid cloning large fields when listing proposals #3505
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
max-dfinity
approved these changes
Jan 17, 2025
jasonz-dfinity
force-pushed
the
jason/NNS1-2973-2
branch
2 times, most recently
from
January 21, 2025 21:26
95c8e2a
to
4d9e416
Compare
jasonz-dfinity
force-pushed
the
jason/NNS1-2973-3
branch
from
January 21, 2025 21:36
6fbc513
to
424a0db
Compare
jasonz-dfinity
force-pushed
the
jason/NNS1-2973-2
branch
from
January 21, 2025 21:56
4d9e416
to
6e64de2
Compare
jasonz-dfinity
force-pushed
the
jason/NNS1-2973-3
branch
from
January 22, 2025 00:40
424a0db
to
650e118
Compare
jasonz-dfinity
force-pushed
the
jason/NNS1-2973-2
branch
from
January 22, 2025 19:37
5f5a15d
to
10e91cd
Compare
jasonz-dfinity
force-pushed
the
jason/NNS1-2973-3
branch
from
January 23, 2025 00:05
650e118
to
fc2feea
Compare
basvandijk
approved these changes
Jan 23, 2025
jasonz-dfinity
force-pushed
the
jason/NNS1-2973-3
branch
3 times, most recently
from
January 24, 2025 00:03
e6ccd24
to
bd89934
Compare
kpop-dfinity
approved these changes
Jan 24, 2025
//rs/tests/consensus changes LGTM |
jasonz-dfinity
force-pushed
the
jason/NNS1-2973-3
branch
2 times, most recently
from
January 24, 2025 21:55
a20bff2
to
f751e43
Compare
DSharifi
approved these changes
Jan 27, 2025
jasonz-dfinity
force-pushed
the
jason/NNS1-2973-3
branch
from
January 27, 2025 22:35
f751e43
to
a2f7224
Compare
gregorydemay
approved these changes
Jan 28, 2025
jasonz-dfinity
force-pushed
the
jason/NNS1-2973-3
branch
from
January 28, 2025 18:22
a2f7224
to
55e025b
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
When converting from
ProposalData
toProposalInfo
, the large fields (e.g. canister WASMs, logos) are "omitted" in a way that those fields are first cloned then cleared. It indeed saves space in the response by not including them, but the instructions are nevertheless wasted for the clone, and this can be significant for certain queries (e.g. listing only proposals including canister WASMs).What
ProposalInfo
/ListProposalInfoResponse
pure API types, by removing its corresponding internal typeproposal_data_to_info
from theProposalData
internal type toProposalInfo
API typeomit_large_fields
in the conversion codeGovernance::list_proposals
use the new conversion method and returnListProposalInfoResponse
(API type)Tests
rs/nns/governance/tests/governance.rs
already tests various cases foromit_large_fields