Skip to content

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

Merged
tsachiherman merged 43 commits into
mainfrom
tsachi/ledgerentries
Oct 13, 2023
Merged

tsachiherman merged 43 commits into
mainfrom
tsachi/ledgerentries

Conversation

@tsachiherman

@tsachiherman tsachiherman commented Sep 1, 2023 •

Copy link
Copy Markdown
Contributor

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

2opremio commented Sep 1, 2023 •

Copy link
Copy Markdown
Contributor

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.

@2opremio 2opremio left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread cmd/soroban-rpc/internal/db/ledgerentry.go Outdated
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
Comment thread cmd/soroban-rpc/internal/methods/get_ledger_entries.go
Comment thread cmd/soroban-rpc/internal/preflight/preflight.go
Comment thread cmd/soroban-rpc/internal/test/cli_test.go

@sreuland sreuland left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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 dismissed 2opremio’s stale review October 13, 2023 23:58

Requests applied

@tsachiherman
tsachiherman merged commit 967351b into main Oct 13, 2023
@tsachiherman
tsachiherman deleted the tsachi/ledgerentries branch October 13, 2023 23:58
@2opremio

Copy link
Copy Markdown
Contributor

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

@tsachiherman

Copy link
Copy Markdown
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