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

soroban-rpc: get expiration ledger sequence at source #916

Merged
merged 43 commits into from
Oct 13, 2023

Conversation

tsachiherman
Copy link
Contributor

@tsachiherman tsachiherman commented Sep 1, 2023

What

The current implementation is making multiple requests between the rust and go code when fetching the ledger entries and their corresponding ledger expiration entries.

This PR merge them both, as well as return the expired ledger sequence to the getLedgerEntries endpoint.

Note that this PR is based on https://github.com/stellar/soroban-tools/pull/913/files

@2opremio
Copy link
Contributor

2opremio commented Sep 1, 2023

As I mentioned at #913 I don't think it makes sense to implement this without hiding the expiration ledger entries from the end user. Otherwise it's redundant.

In addition, as it is today, the user can request expiration entries. The hashing can be provided by a library and I don't see it as that big a hurdle. Either way, I would provide the expirations on the response or give the user access to the ledger expiration ledger entries, not both.

Finally, as a UX improvement and library optimization, this isn't in the critical line for the testnet release. Let's please park it and focus on testing until then.

Copy link
Contributor

@2opremio 2opremio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per my comments above, I don't think we should allow accessing raw Expiration ledger entries and providing the expiration in a separate way. I would go one way or the other.

tsachiherman and others added 7 commits October 11, 2023 16:30
* fix: add latest_modified_ledger to FullLedgerEntry

Also simplifies parsing FullLedgerEntry

* fix: CLI test for contract read

* fix: update tests to use getLedgerEntries

* fix: nit
Copy link
Contributor

@sreuland sreuland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, I'm light on rust side, on rpc side, left one other comment for consideration related to test coverage of expirationLedgerSeq=nil, such as when getLedgerEntries on a non-expirable LE like Account.

@tsachiherman
Copy link
Contributor Author

I'm going to merge this for now, but open to additional unit testing ideas.

@tsachiherman tsachiherman enabled auto-merge (squash) October 13, 2023 23:58
@tsachiherman tsachiherman merged commit 967351b into main Oct 13, 2023
22 checks passed
@tsachiherman tsachiherman deleted the tsachi/ledgerentries branch October 13, 2023 23:58
@2opremio
Copy link
Contributor

@tsachiherman did you modify the docs to include the API changes?

@tsachiherman
Copy link
Contributor Author

@tsachiherman did you modify the docs to include the API changes?

not yet. I will follow up on that. I wanted to prioritize merging this one in so it won't block the js clients.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

soroban-rpc: Better state expiration support for getLedgerEntry
6 participants