-
Notifications
You must be signed in to change notification settings - Fork 13
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
refactor(iota-core): Add more comments for ReadApi::try_get_object_before_version
#3844
refactor(iota-core): Add more comments for ReadApi::try_get_object_before_version
#3844
Conversation
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.
Could you please elaborate on why this is deprecated?
Yeah this is a good question. #[method(name = "tryGetObjectBeforeVersion", deprecated = "true")]
async fn try_get_object_before_version( This was listed in #2092 and identified by @thibault-martinez, maybe Thibault can elaborate better? |
I'm afraid I can't expand on the why... I just listed everything flagged as deprecated for further investigation. |
@kodemartin @thibault-martinez Based on the original SUI PR here for the deprecated mark, it says this is only used by sui replay tool. I think it might be fine to keep it for now. Would like to know your opinions, thanks. |
Thanks for your answers @bingyanglin @thibault-martinez! I missed the I see that the implementation in iota/crates/iota-core/src/authority/authority_store.rs Lines 1421 to 1426 in 1c55189
Given that it seems to be some underlying utility, and that the calling method is not deprecated I agree with @bingyanglin that we should keep it as well. |
Definitely fine by me! Maybe I would transform this PR into leaving a small comment about why it's deprecated and kept, but it's also fine without. |
a069036
to
ca140b3
Compare
Thanks @kodemartin and @thibault-martinez for the reply. I added more comments in ca140b3 and keep this endpoint. |
ReadApi::try_get_object_before_version
ReadApi::try_get_object_before_version
Co-authored-by: Thibault Martinez <[email protected]>
Why not remove the |
Agreed. Removed the flag at 6dd98c8. |
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.
lgtm 🌸
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.
It was introduced as already deprecated to avoid people calling it directly, if we think that's not an issue then LGTM!
crates/iota-json-rpc-api/src/read.rs
Outdated
// underlying utility, e.g., `RemoteFetcher::get_child_object` uses | ||
// `try_get_object_before_version` to get the object with the versions <= | ||
// the given version. Thus we keep this endpoint for now. | ||
#[method(name = "tryGetObjectBeforeVersion")] |
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.
I think we should keep the deprecated flag here.
As far as I understand, having the flag causes it to not be exposed in the generated spec file.
Since it should be only for internal usage, I guess the comment is enough to not remove the function, even though it is marked as deprecated (I guess they did it for the same reason as explained).
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.
Let's keep the flag to make it clearer. Added the flag at 5c480e4.
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.
Also enhanced the comment at 8abb3b9.
Description of change
Links to any relevant issues
Part of #2092
Type of change
How the change has been tested
Ran the local network with
RUST_LOG=info cargo run --release --bin iota start --force-regenesis --with-faucet
Change checklist
Tick the boxes that are relevant to your changes, and delete any items that are not.