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

exp/lighthorizon: enforce the limit from request on the response size #4431

Merged
merged 18 commits into from
Jun 30, 2022

Conversation

sreuland
Copy link
Contributor

@sreuland sreuland commented Jun 13, 2022

check the page limit parameter on tx and ops listing requests, it should determine the response results size.
Closes #4430

Confirmed by live testing, exported and indexed small ledger range,

START_LEDGER= 1538223
STOP_LEDGER= 1538323

/transactions processes the cursor and limit query string parameters, if no limit defaults to 10

request by cursor: l=1538223, t=1, o=1

GET localhost:8080/transactions?cursor=6606617478959105&limit=2

{
  "_links": {
    "self": {
      "href": "https://localhost:8080/transactions?cursor=\u0026limit=0\u0026order="
    },
    "next": {
      "href": "https://localhost:8080/transactions?cursor=6606621773930497\u0026limit=0\u0026order="
    },
    "prev": {
      "href": "https://localhost:8080/transactions?cursor=6606621773926401\u0026limit=0\u0026order=asc"
    }
  },
  "_embedded": {
    "records": [
      {
        "memo": "xdr.Memo{Type: xdr.MemoTypeMemoNone}",
        "_links": {
          "self": {
            "href": "https://localhost:8080/transactions/544469b76cd90978345a4734a0ce69a9d0ddb4a6595a7afc503225a77826722a"
          },
          "account": {
            "href": ""
          },
          "ledger": {
            "href": ""
          },
          "operations": {
            "href": ""
          },
          "effects": {
            "href": "https://localhost:8080/transactions/544469b76cd90978345a4734a0ce69a9d0ddb4a6595a7afc503225a77826722a/effects"
          },
          "precedes": {
            "href": "https://localhost:8080/effects?order=asc\u0026cursor=6606621773926401"
          },
          "succeeds": {
            "href": "https://localhost:8080/effects?order=desc\u0026cursor=6606621773926401"
          },
          "transaction": {
            "href": ""
          }
        },
        "id": "544469b76cd90978345a4734a0ce69a9d0ddb4a6595a7afc503225a77826722a",
        "paging_token": "6606621773926401",
        "successful": true,
        "hash": "544469b76cd90978345a4734a0ce69a9d0ddb4a6595a7afc503225a77826722a",
        "ledger": 1538224,
        "created_at": "2022-06-17T23:29:42Z",
        "source_account": "GBGTCH47BOEEKLPHHMR2GOK6KQFGL3O7Q53FIZTJ7S7YEDWYJ5IUDJDJ",
        "source_account_sequence": "",
        "fee_account": "",
        "fee_charged": "84000",
        "max_fee": "0",
        "operation_count": 28,
        "envelope_xdr": "AAAAAgAAAABNMR-fC4hFLec7I6M5XlQKZe3fh3ZUZmn8v4IO2E9RQQABSCAADOFXAABwTwAAAAAAAAAAAAAAHAAAAAAAAAADAAAAAUVVUlYAAAAAL3ZBkx0hzBH3SxRQmbsxJvS0lyUOUUEqMkdUbvATQ00AAAABVVNEVgAAAAAvdkGTHSHMEfdLFFCZuzEm9LSXJQ5RQSoyR1Ru8BNDTQAAAAAAAAAAAAAAAQCYloAAAAAAAAZ-OwAAAAAAAAADAAAAAUVVUlYAAAAAL3ZBkx0hzBH3SxRQmbsxJvS0lyUOUUEqMkdUbvATQ00AAAABVVNEVgAAAAAvdkGTHSHMEfdLFFCZuzEm9LSXJQ5RQSoyR1Ru8BNDTQAAAAAAAAAAAAAAAQCYloAAAAAAAAZ-PgAAAAAAAAADAAAAAUVVUlYAAAAAL3ZBkx0hzBH3SxRQmbsxJvS0lyUOUUEqMkdUbvATQ00AAAABVVNEVgAAAAAvdkGTHSHMEfdLFFCZuzEm9LSXJQ5RQSoyR1Ru8BNDTQAAAAAAAAAAAAAAAQCYloAAAAAAAAZ-OAAAAAAAAAADAAAAAUVVUlYAAAAAL3ZBkx0hzBH3SxRQmbsxJvS0lyUOUUEqMkdUbvATQ00AAAABVVNEVgAAAAAvdkGTHSHMEfdLFFCZuzEm9LSXJQ5RQSoyR1Ru8BNDTQAAAAAAAAAAAAAAAQCYloAAAAAAAAZ-OgAAAAAAAAADAAAAAUVVUlYAAAAAL3ZBkx0hzBH3SxRQmbsxJvS0lyUOUUEqMkdUbvATQ00AAAABVVNEVgAAAAAvdkGTHSHMEfdLFFCZuzEm9LSXJQ5RQSoyR1Ru8BNDTQAAAAAA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hFNkGmUG1AAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAE0xH58LiEUt5zsjozleVApl7d-HdlRmafy_gg7YT1FBAAAAAAAGflMAAAABVVNEVgAAAAAvdkGTHSHMEfdLFFCZuzEm9LSXJQ5RQSoyR1Ru8BNDTQAAAAFFVVJWAAAAAC92QZMdIcwR90sUUJm7MSb0tJclDlFBKjJHVG7wE0NNAAAAAAQxGOcJAfp4CU7cgAAAAAAAAAAAAAAAAA==",
        "result_meta_xdr": "",
        "fee_meta_xdr": "",
        "memo_type": "MemoTypeMemoNone",
        "signatures": [
          "2E9RQQAAAEDOHy2IQJTNEz9kgUbHYolo_qjWo5s1ZkHOo70AQM2DRVWSNb4Py043HLbgZ6B5WdgkAs3gzoQ9sYk77KVZ5CsG"
        ]
      },
      {
        "memo": "xdr.MemoText(\"psp:1405\")",
        "_links": {
          "self": {
            "href": "https://localhost:8080/transactions/5fef21d5ef75ecf18d65a160cfab17dca8dbf6dbc4e2fd66a510719ad8dddb09"
          },
          "account": {
            "href": ""
          },
          "ledger": {
            "href": ""
          },
          "operations": {
            "href": ""
          },
          "effects": {
            "href": "https://localhost:8080/transactions/5fef21d5ef75ecf18d65a160cfab17dca8dbf6dbc4e2fd66a510719ad8dddb09/effects"
          },
          "precedes": {
            "href": "https://localhost:8080/effects?order=asc\u0026cursor=6606621773930497"
          },
          "succeeds": {
            "href": "https://localhost:8080/effects?order=desc\u0026cursor=6606621773930497"
          },
          "transaction": {
            "href": ""
          }
        },
        "id": "5fef21d5ef75ecf18d65a160cfab17dca8dbf6dbc4e2fd66a510719ad8dddb09",
        "paging_token": "6606621773930497",
        "successful": false,
        "hash": "5fef21d5ef75ecf18d65a160cfab17dca8dbf6dbc4e2fd66a510719ad8dddb09",
        "ledger": 1538224,
        "created_at": "2022-06-17T23:29:42Z",
        "source_account": "GCFJN22UG6IZHXKDVAJWAVEQ3NERGCRCURR2FHARNRBNLYFEQZGML4PW",
        "source_account_sequence": "",
        "fee_account": "",
        "fee_charged": "3000",
        "max_fee": "0",
        "operation_count": 1,
        "envelope_xdr": "AAAAAgAAAACKlutUN5GT3UOoE2BUkNtJEwoipGOinBFsQtXgpIZMxQAAJxAAE05oAAHUKAAAAAEAAAAAAAAAAAAAAABirQ6AAAAAAQAAAAhwc3A6MTQwNQAAAAEAAAAAAAAAAQAAAADpPdN37FA9KVcJfmMBuD8pPcaT5jqlrMeYEOTP36Zo2AAAAAJBVE1ZUgAAAAAAAAAAAAAAZ8rWY3iaDnWNtfpvLpNaCEbKdDjrd2gQODOuKpmj1vMAAAAAGHAagAAAAAAAAAABpIZMxQAAAEDNJwYToiBR6bzElRL4ORJdXXZYO9cE3-ishQLC_fWGrPGhWrW7_UkPJWvxWdQDJBjVOHuA1Jjc94NSe91hSwEL",
        "result_xdr": "AAAAAAAAC7j_____AAAAAQAAAAAAAAAB____-gAAAAA=",
        "result_meta_xdr": "",
        "fee_meta_xdr": "",
        "memo_type": "MemoTypeMemoText",
        "signatures": [
          "pIZMxQAAAEDNJwYToiBR6bzElRL4ORJdXXZYO9cE3-ishQLC_fWGrPGhWrW7_UkPJWvxWdQDJBjVOHuA1Jjc94NSe91hSwEL"
        ]
      }
    ]
  }
}

@sreuland sreuland changed the title exp/lighthorizon: utilize indices when finding ledgers for lookup exp/lighthorizon: enforce the limit from request on the reponse size of tx list Jun 13, 2022
@sreuland sreuland marked this pull request as ready for review June 18, 2022 01:11
@sreuland sreuland requested review from Shaptic, paulbellamy and a team June 21, 2022 20:21
@Shaptic
Copy link
Contributor

Shaptic commented Jun 23, 2022

Just getting around to reviewing this - sorry for the delay. Are you sure the noted test actually respects the limit? I see

        "ledger": 1538224

in both records, meaning it never had to look up or ingest another. So it may be that it works w/ multiple transactions w/in the same ledger, but not for multiple.

exp/lighthorizon/actions/main.go Outdated Show resolved Hide resolved
}

if orderRequested != "" && orderRequested == string(OrderDesc) {
paginate.Order = OrderDesc
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we have an "invalid order" error if orderRequested != "asc" or "desc"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

how do you feel about the minimal approach first, having the api do some opinionated error proofing rather than more chatter? will put in the error response, but wanted to get a read on that style aspect first?

Copy link
Contributor

Choose a reason for hiding this comment

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

I have no strong opinion, agreed that we should keep things minimal to keep eyes on the prize - aka working mvp

exp/lighthorizon/actions/operation.go Outdated Show resolved Hide resolved
exp/lighthorizon/actions/transaction.go Outdated Show resolved Hide resolved
@sreuland sreuland mentioned this pull request Jun 23, 2022
7 tasks
@sreuland
Copy link
Contributor Author

Just getting around to reviewing this - sorry for the delay. Are you sure the noted test actually respects the limit? I see

        "ledger": 1538224

in both records, meaning it never had to look up or ingest another. So it may be that it works w/ multiple transactions w/in the same ledger, but not for multiple.

great catch, I think have fixed with this commit. archive.GetTransactions wasn't incrementing tx order num all the time, resulted in skipping all tx's in the first ledger encoded in cursor.

Copy link
Contributor

@Shaptic Shaptic left a comment

Choose a reason for hiding this comment

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

Seems like we're close! Would be really good to get some test cases as a follow-up so that we can analyze exactly what behavior is expected/reproducible/working, maybe in a follow-up PR.

@@ -69,6 +70,7 @@ func (a *Wrapper) GetOperations(cursor int64, limit int64) ([]common.Operation,

for operationOrder := range tx.Envelope.Operations() {
currID := toid.New(int32(ledgerSequence), transactionOrder+1, int32(operationOrder+1)).ToInt64()
transactionOrder++
Copy link
Contributor

Choose a reason for hiding this comment

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

Wait, I'm not entirely sure this is correct. cc @stellar/horizon-committers - does anyone know how TOIDs work? I get operation order but I don't understand transaction order. Is it essentially an index into the list of transactions in a ledger?

Copy link
Contributor

Choose a reason for hiding this comment

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

If yes, then this isn't right because we're still w/in the same transaction.

What I was referring to in my earlier comment, @sreuland, is that we aren't using the index in this part of the code. Once we've adjusted the cursor from the URL parameters to the next active checkpoint (done), we need to adjust the cursor until we've found enough ledgers to fulfill limit, here. On Line 99 you can see ledgerSequence++, but in reality we want ledgerSequence = index.nextActive(..., (ledgerSequence + 1) / 64).

Copy link
Contributor Author

@sreuland sreuland Jun 24, 2022

Choose a reason for hiding this comment

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

that was a mistake on my part, i incremented it in wrong place, I pushed a correction to only increment the tx order on the outside of ops loop. I'm working on a unit test here to assert the expectations.

On you point about not using the index, it appears like multiple optimal paths for the queries, when just cursor and no other query params, the results list is just a sequential listing of ops or txs from that start point, and can resolve that with just toid and the ledger backend reader, there's no value to using index there right, however, when the account query parameter is included at least as here on ops, then index.nextActive needs to be used rather than sequential toid iteration.

I think I'm working on this now for #4433, the net will be refactor the account param off /operations?account= and over to /accounts/:id/operations?cursor=&limit= and will be changing archive.GetOperations to leverage index.nextActive in the way you're recommending.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Shaptic , I added tests on archive op/tx retreival , asserts what data is on the index/archive side and what's expected on the results side, may help detect if there is a gap in current impl vs. design intent.

Copy link
Contributor

Choose a reason for hiding this comment

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

According to SEP 35 both the transaction and operation order start at 1:

Transaction Application Order: the order that the transaction was applied within the ledger where it was validated. This takes up 20 bits of the id, from bits 32 to 51, inclusive. The application order value starts at 1. The maximum supported number of transactions per operation is 1,048,575.

Operation Index: the index of the operation within its parent transaction. This takes up 12 bits of the id, from bits 52 to 63, inclusive. The operation index value starts at 1. The maximum supported number of operations per transaction is 4095.

Thus, I think that the code is correct.

However, I would suggest bookeeping an toid.ID instead of maintaining the three counters separately.

@sreuland
Copy link
Contributor Author

Seems like we're close! Would be really good to get some test cases as a follow-up so that we can analyze exactly what behavior is expected/reproducible/working, maybe in a follow-up PR.

I think it's worth taking a bit of time to establish some test coverage here, I'll look into a unit test with mocked backend/store.

@sreuland sreuland changed the title exp/lighthorizon: enforce the limit from request on the reponse size of tx list exp/lighthorizon: enforce the limit from request on the response size Jun 25, 2022
@sreuland sreuland requested a review from 2opremio June 28, 2022 02:27
Comment on lines +32 to +46
func (adaptation *ingestTransactionReaderAdaption) Read() (LedgerTransaction, error) {
tx := LedgerTransaction{}
ingestLedgerTransaction, err := adaptation.LedgerTransactionReader.Read()
if err != nil {
return tx, err
}

tx.Index = ingestLedgerTransaction.Index
tx.Envelope = ingestLedgerTransaction.Envelope
tx.Result = ingestLedgerTransaction.Result
tx.FeeChanges = ingestLedgerTransaction.FeeChanges
tx.UnsafeMeta = ingestLedgerTransaction.UnsafeMeta

return tx, nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, this might be a misunderstanding on my part, but what is the benefit of wrapping ingestion into a similar structure like this for light horizon? I can't see what it offers that the ingest package doesn't already (which is meant for public consumption as-is). Basically - why this over what was present before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the objective was to see about LightHorizon(LH) programing to its own domain model, its notion of LedgerTransaction could diverge from ingest or vice versa at any point perhaps or no? LH has defined the new Archive interface which refers to TX's so the model ends up being referenced all around in LH. This allowsingest's version of model to be used, but encapsulated to here, the rest of LH does not know ingest exists, is that worthwhile as a building block? If the abstraction just adds more complexity than it's worth, I'll yank this out np, lmk, thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

thought about this some more, this is a good question...

its notion of LedgerTransaction could diverge from ingest or vice versa at any point perhaps or no?

I think it's a safe bet that we'll need to do this - @paulbellamy already mentioned how we should add versioning to the meta files, which would be data on top of the xdr.LedgerCloseMeta -> ingest.LedgerTransaction ingestion layer. But the changes will be purely additive.

I'm not psyched about the naming ("adaption" and "adaptation") but that's not a blocker by any means hah; we can solve that later. (It's one of the two hard things in CS, anyway.)

@@ -240,7 +240,7 @@ func mergeAllIndices(finalIndexStore index.Store, config *ReduceConfig) error {
}
}

logger.Infof("Final account flush.")
jobLogger.Infof("Final account flush.")
Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for fixing all of the warnings 🙏

Copy link
Contributor

@Shaptic Shaptic left a comment

Choose a reason for hiding this comment

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

:shipit:

@sreuland sreuland merged commit 00ae4ed into stellar:lighthorizon Jun 30, 2022
Shaptic added a commit that referenced this pull request Jan 9, 2024
* exp/lighthorizon: Add initial support for XDR serialization (#4369)
* exp/lighthorizon: Improve trie tests to avoid raw comparisons/outputs. (#4373)
* exp/lighthorizon: Add XDR marshalling for the `TrieNode` structure. (#4375)
* Add encoding stdlib interfaces
* lighthorizon: Sync with upstream master branch (#4404)
* services/ticker: ingest assets optimizations (#4218)
* Add CHANGELOG entry for Horizon 2.14.0 release (#4208) (#4220)
* Make sure we test reingestion for all possible operations (#4231)
* services/horizon: Allow captive core to run with sqlite database (#4092)
* services/horizon: Release DB connection in /paths when no longer needed (#4228)
* services/horizon: Exclude trades with >10% rounding slippage from trade aggregations (#4178)
* all: staticcheck fixes (#4239)
* Migrate Horizon integration tests to GitHub Actions (#4242)
* Fix StreamAllLiquidityPools and StreamAllOffers (#4236)
* all: run builds and tests with go1.18rc1 (#4143)
* all: cache go module downloads and other build and test artifacts (#3727)
* services/horizon: Add LedgerHashStore to Captive-Core config (#4251)
* all: migrate the rest of the CircleCI jobs to GitHub Actions (#4250)
* horizon: Fix GitHub action problem with verify-range push in master (#4253)
* all: fix ci ref_protected check for caching (#4254)
* Switch over from CircleCI to GitHub A tions (#4256)
* all: [GitHub actions] Reset the module and build cache in master/protected (#4266)
* Forgot to add sudo in #4266 (#4270)
* all: More go-setup github action fixes (#4274)
* xdr: add instructions for generating xdr (#4280)
* services/ticker: cache tomls during scraping (#4286)
* services/ticker: use log fields during asset ingestion (#4288)
* services/ticker: reduce size of toml cache in memory (#4289)
* historyarchive: add --skip-optional flag (#3906)
* all: Add Protocol 19 XDR and update StrKey to support Signed Payloads (#4279)
* Replace keybase with publicnode in the stellar core config (#4291)
* Fix captive core tests to write to /tmp, instead of polluting the repo (#4296)
* all: remove go1.16 add go1.18 (#4284)
* Rename methods and functions in submission system (#4298)
* PR feedback (#4300)
* Support new account fields for protocol-19. (#4294)
* xdr, keypair: Add helpers to create CAP-40 decorated signatures (#4302)
* services/horizon: Update txsub queue to account for new CAP-21 preconditions (#4301)
* Uncomment StateVerifier test that generates account v3 extensions now that they are implemented. (#4304)
* txnbuild: Add support for new CAP-21 preconditions. (#4303)
* services/horizon: Support new CAP-21 transaction conditions (#4297)
* txnbuild: Complete rename, avoid using XDR types in `TransactionParams`. (#4307)
* all: Update Protocol 19 XDR to the latest (#4308)
* services/horizon: Add a rate limit for path finding requests. (#4310)
* clients/horizonclient: fix multi-parameter url for claimable balance query (#4248)
* all: Fix Horizon integration tests (#4292)
* horizon: Fix integration tests (#4314)
* horizon: Set up protocol 19 integration tests infrastructure (#4312)
* all: Change outdated CircleCI build badge (#4324)
* horizon: Test new protocol 19 account fields (#4322)
* all: update staticcheck to 2022.1 (#4326)
* all: remove go.list and related docs (#4328)
* horizon: Add transaction submission test for Protocol 19 (#4327)
* Horizon v2.16.1 CHANGELOG (#4333)
* Revert "Pin go versions temporarily" (#4338)
* services/horizon: Use `bigint` over `timestamp` to accommodate large years (#4337)
* xdr: Update xdrgen (#4341)
* services/horizon: Change `min_account_sequence_age` column from `bigint` to string (#4339)
* services/horizon: Bump stellar-core to v19.0.0rc1 for Horizon tests (#4345)
* services/horizon: expose supported protocol version on root endpoint (#4347)
* horizon: Small transaction submission refactoring (#4344)
* services/horizon: Pass through nil ExtraSigners to avoid nil pointer deref (#4349)
* doc: rename license file (#4350)
* all: upgrade dep github.com/valyala/fasthttp (#4351)
* services/horizon: Promote Stellar Core to v19.0.0 stable. (#4353)
* services/horizon/integration: Precondition edge cases and V18->19 upgrade boundary. (#4354)
* xdr: Synchronizes monorepo XDR with Stellar Core (#4355)
* services/horizon: Properly allow nullable Protocol 19 account fields (#4357)
* services/friendbot: include txhash in logs (#4359)
* services/horizon: Improve transaction precondition `omitempty` behavior (#4360)
* tools/horizon-cmp: Improve panic error message (#4365)
* services/horizon: Merge stable v2.17.0 back into master: (#4363)
* Use UNIX timestamps instead of RFC3339 strings for timebounds. (#4361)
* xdrgen: remove gemfile and rakefile to just use docker for the xdrgen (#4366)
* Conservatively limit the number of DB connections of integration tests (#4368)
* internal/integrations: db_test should drop test db instances when finished (#4185)
* GHA: Bump Core version to v19.0.1 in Horizon workflows. (#4378)
* services/horizon, clients/horizonclient: Allow filtering ingested transactions by account or asset. (#4277)
* Push stellar/ledger-state-diff images from Github actions (#4380)
* services/horizon: Fixes copy-paste typo in `--help` text (#4383)
* tools/alb-replay: Add new features to alb-replay (#4384)
* services/horizon: Optimize claimable balances query to limit records earlier (#4385)
* support/db, services/horizon/internal: Configure postgres client connection timeouts for read only db (#4390)
* Refactor trade aggregation query. (#4389)
* services/horizon/internal/db2/history: Implement StreamAllOffers using batches (#4397)
* Add flag to disable path finding endpoints (#4399)

Co-authored-by: stfung77 <[email protected]>
Co-authored-by: Leigh McCulloch <[email protected]>
Co-authored-by: Alfonso Acosta <[email protected]>
Co-authored-by: Paul Bellamy <[email protected]>
Co-authored-by: Bartek Nowotarski <[email protected]>
Co-authored-by: tamirms <[email protected]>
Co-authored-by: Alfonso Acosta <[email protected]>
Co-authored-by: Graydon Hoare <[email protected]>
Co-authored-by: Satyam Zode <[email protected]>
Co-authored-by: Satyam Zode <[email protected]>
Co-authored-by: erika-sdf <[email protected]>
Co-authored-by: iateadonut <[email protected]>
Co-authored-by: Shawn Reuland <[email protected]>
Co-authored-by: shawn <[email protected]>
Co-authored-by: Shivendra Mishra <[email protected]>
Co-authored-by: Jacek Nykis <[email protected]>
Co-authored-by: jacekn <[email protected]>

* Explain map and reduce commands

* exp/lighthorizon: Refactor single-process index builder. (#4410)

* Refactor index builder:
 - allow worker count to be a command line parameter
 - split work by checkpoints rather than ledgers
 - move actual index insertion work to helpers
 - move progress bar into helpers
 - simplify participants code, payments vs. all
* Properly work on a checkpoint range at a time:
 - previously, it was just arbitrary 64-ledger chunks which is not as helpful
* Define a generic module processing function
* Move index building into a separate object
* Fix off-by-one error in checkpoint index builder:
  - Keeping this as-is would mean that the first chunk of ledgers
    will be "Checkpoint 0" which doesn't make sense in the bitmap
  - Calling index.setActive(0) is essentially a no-op, because no
    bit will ever be set.
  - In the case of an empty index in which the only active account
    checkpoint is the first one, this is indistinguishable from an
    index with no activity.

* exp/services/ledgerexporter: Extend tool to support lower ledger bound. (#4405)

* exp/lighthorizon: Refactor and repair the reduce job (#4424)

* Use envvars for every configurable thing, incl. index sources and final merged
  index target:

    This removes any hard dependency on S3 and lets you use any supported
    backend for the map-reduce operation. It was done specifically with local
    filesystem-based testing in mind, but naturally opens up other backends as
    well.

* Add lots of helper functions:

    Specifically, helpers now exist for both merging two sets of named indices
    together and partitioning work based on the account/transaction hashes into
    separate jobs/routines.

* Lots more logging! For progress tracking, debugging, etc.

* Create a thread-safe string set abstraction for tracking completed work.

* Better error handling: 

    `os.IsNotExist(err)` is much more reliable over a direct equality check to
    `ErrNotExist`. This also ties in to backend-independence. 

    We can also log and return an error rather than immediately panicking on its
    occurrence.

* Transaction flushes need to be thread-safe if they're going to be done from
  different goroutines during reduction.

    Otherwise, you get panics from concurrent writes to its maps.

* The "account list" (aka the file containing a list of all accounts in the
  partitioned index) needs to be flushed at the same time as the index itself:

    If this isn't done, then `FlushAccounts()` will do absolutely nothing after
    a `Flush()`, because the previous `Flush()` will clear the map of indices
    out of memory. Since the account list comes from memory, it becomes a no-op.

* Split work across multiple channels rather than just one

    If the work comes from a single channel, accounts can get skipped overall
    because they aren't put back on the queue if they're skipped by a single
    worker.

    It makes more sense to make each worker have its own channel, partitioning
    the work *before* it gets to the worker rather than after.

* exp/lighthorizon: Unify map-reduce and single-process index builders (#4423)

* Main thing: `./index/cmd/single` and `./index/cmd/batch/map` now leverage the
  same index building code (i.e. `BuildIndices`)

* This also extends the map-reduce builder to take the txmeta source / index
  destination URLs from envvars rather:

    This eliminates a hard dependency on S3, and it's done here because
    splitting that out from the giga-PR was difficult.

* We can infer checkpoints from `ledger.LedgerSequence()` rather than passing
  them in as a parameter, which cleans up modules.

* This finally adds a new `ProcessAccountsWithoutBackend` module for the Map job

* exp/lighthorizon: Thread-safe support for reading account list via FileBackend (#4422)

Three key changes:

    - actually read the account list when using a filesystem backend
    - using `O_APPEND` on the file to support concurrent writes
    - ensure that the read list is a unique set of accounts

* exp/lighthorizon: Restructure index package into sensible sub-packages (#4427)

* exp/lighthorizon: Merge on-disk index with in-memory one on load. (#4435)

* Add test for single-process index builder
* Merge in-memory index with on-disk one when loading
* Add fixture of unpacked ledgers for fast local testing
* Isolate the index we need to merge
* Use a ByteReader so that multiple indices in one file work 🤦
* Add to/from XDR support to bitmap index
* Fix and extend gzip tests to handle the bytereader bug
* Simplify participant processing code

* exp/lighthorizon: Allow indexer to continually update as new txmeta appears (#4432)

* exp/lighthorizon: enforce the limit from request on the response size  (#4431)

* Dockerize ledgerexport to run in AWS Batch

This Change:

1. Creates docker image (stellar/horizon-ledgerexporter) which works in a similar fashion to stellar/horizon-verify-rage
   and is tested and pushed as part of the Horizon GitHub workflow.
2. Adds two more parameters to ledgerexporter
   * --end-ledger: which indicates at what ledger to stop the export
   * --write-latest-path: which indicates whether to udpate the /latest path of the target

Latest path writing is disabled in the container by default in order to avoid race-conditions between parallel jobs

* exp/lighthorizon: Add test for batch index building map job (#4440)

* Modify single-process test to generalize to whatever fixture data exists
This also adds a test to check that single-process works on a non-checkpoint
starting point which is important.

* Fix map program to properly build sub-paths depending on its job index
Previously, this only happened for explicitly S3 backends.

* Make map job default to using all CPUs
* Stop clearing indices from memory if using unbacked module
* Use historyarchive.CheckpointManager for all checkpoint math
* Update lastBuiltLedger w/ safely concurrent writes

* Refactor bound preparation and add --continue flag

* Address review feedback and rework env variable names

* Run gofmt -w (I don't know why those files were changed)

* Add proper logging to indicate what range is being exported

* Add clarification about end ledger

* Fix boolean argument passing

* Address review feedback

* Address feedback

* Use sqlite for captive core

* exp/lighthorizon: Add basic scaffolding for metrics. (#4456)

* Use correct network passphrase when populating transaction
* Add scaffolding for Prom/log metrics and some example ones
* Misc. clarifications and fixes to the index builder

* lighthorizon: Prepend version to ledger files (#4450)

* Prepend version to ledger files

* Encode versioning in XDR

* Regenerate fixtures

* Fix ledger fixtures

* Appease govet

* Move all lighthorizon types to /xdr

* exp/lighthorizon/index: More testing for batch indexing and off-by-one bugfix. (#4442)

* Add reduce test to ensure combining map jobs works
* Actually test that TOIDs are correct
* Bugfix: Transaction prefix loop should be inclusive
* Isolate loggers to individual processing "sections"

* Minor ledgerexporter infrastructure improvements (#4461)

* Push the stellar/horizon-ledgerexporter docker image when pushing to the lighthorizon branch
* Fix the ledger exporter aws batch jobs when running on the first batch

* Forgot to add login step to ledgerexporter workflow

* exp/lighthorizon: Set a default number of workers. (#4465)

* Default to the number of CPUs if worker count isn't specified
* Set a timeout on the reduce job to avoid test suite hanging indefinitely

* exp/lighthorizon: Fix the single-process index builder data race. (#4470)

* Add synchronization for the work submission routine. Thank you @sreuland!

Co-authored-by: shawn <[email protected]>

* /exp/lighthorizon: new endpoints for tx and ops paged listing by account id (#4453)

* exp/lighthorizon: Add an on-disk cache for frequently accessed ledgers. (#4457)

* Replace custom LRU solution with an off-the-shelf data structure.
* Add a filesystem cache in front of the ledger backend to lower latency
* Add cache size parameter; only setup cache if not file:https://
* Extract S3 region from the archive URL if it's applicable.

* exp/lighthorizon/index: Drop building indices for successful transactions. (#4482)

* Add metrics middleware to collect request duration metrics (#4486)

* exp/lighthorizon: Isolate cursor advancement code to its own interface (#4484)

* Move cursor manipulation code to a separate interface
* Small test refactor to improve readability and long-running lines
* Combine tx and op tests into subtests
* Fix how IndexStore is mocked out

* exp/lighthorizon/index: Parse network passphrase from the env. (#4491)

* Refactor access to meta archive (#4488)

Refactor `historyarchive` and `ledgerbackend` to allow better access to the new meta archives:
* Created `metaarchive` package that connects to the new meta archives (and
  allows accessing `xdr.SerializedLedgerCloseMeta`).
* Extracted `ArchiveBackend` to the new `support/storage` package as it contains
  only storage related methods. New package is used in both `historyarchive` and
  `metaarchive`.

* exp/lighthorizon: Add response age prometheus metrics (#4492)

* exp/lighthorizon/index: Allow accounts to be indexed by ledger. (#4495)

* Add builders to make account indices by ledger
* Add `MODULE` parameter to map job in batch builder
* Don't build transaction indices by default

* services/horizon/docker/ledgerexporter: deploy ledgerexporter image as service (#4490)

* Make indexing s3 bucket configurable (#4507)

* exp/lighthorizon: Add duration metrics for on-the-fly ingestion elements. (#4476)

Add basic aggregate metrics for request fulfillment:
 - how long did ledger downloads take, on average?
 - how long did ledger processing take, on average?
 - how long did index lookups take, on average?
 - how many ledgers were needed?
 - how long did the entire request take, in total?

* exp/lighthorizon: Add JSON content type to responses. (#4509)

* exp/lighthorizon: *Correctly* set `Content-Type`, plus JSONify errors (#4513)

* exp/lighthorizon/services: Move service-specific stuff to its own file. (#4502)

* exp/lighthorizon, xdr: Rename `CheckpointIndex` to better reflect its capabilty. (#4510)

* Rename NextActive -> NextActiveBit to be descriptive

* exp/lighthorizon: Add a suite of tools to manage the on-disk ledger cache. (#4522)

* Run 'go mod tidy' after merge

* exp/lighthorizon: add horizon web docker/k8s deployment (#4519)

* It seems like the merge caused some deleted files to stay in:

  The commit b3407fd from
  PR #4418 deleted these files, so we just do the same.

  A quick manual inspection showed us that the deltas
  transferred over, just not the deletions, for some reason.
Idk why these changes ended up in the code, kinda sus...

More deleted files snuck in?

* One more that didn't get removed 🤔

* all: Incorporate generics into Light Horizon code. (#4537)

* bump go version to 18 on lighthorizon docker images, they need it now (#4541)

* exp/lighthorizon/actions: use standard Problem model on API error responses (#4542)

* exp/lighthorizon/build/index-batch: carry over map/reduce updates to latest docker layout on feature branch (#4543)

* exp/lighthorizon: Properly transform transactions into JSON. (#4531)

* exp/lighthorizon: Add a set of tools to aide in index inspection. (#4561)

* exp/lighthorizon/cmd: index batch fix s3 sub paths in reduce (#4552)

* exp/lighthorzon: Add a generic, thread-safe `SafeSet`. (#4572)

* support/storage: Make the on-disk cache thread-safe. (#4575)

* exp/lighthorizon: Incorporate tool subcommands into the webserver. (#4579)

* exp/lighthorizon/index/cmd: Fix index single watch, slow down the retry on not-found ledgers  (#4582)

* exp/lighthorizon: Refactor archive interface and support parallel ledger downloads. (#4548)
- Refactor and simplify Archive abstraction to incorporate MetaArchive
- Actually add & use parallel downloads, preparing checkpoint chunks
- Fix test structures and mocking
- Fix cache to ignore on-disk if lockfile present

* exp/lighthorizon: Minor error-handling and deployment improvements. (#4599)
- actually set the PARALLEL_DOWNLOADS parameter to use #4468
- return a 404 rather than a 500 if a ledger is missing as its more descriptive
- handle `count = 0` in average metric calculations
* exp/lighthorizon/index: Add ability to disable bits in index. (#4601)
* exp/lighthorizon: Add parameters to preload ledger cache. (#4615)
* Add ability to preload cache in parallel after launching webserver
* Default to 1 day of ledgers @ 6s each

---------

Co-authored-by: Bartek Nowotarski <[email protected]>
Co-authored-by: Paul Bellamy <[email protected]>
Co-authored-by: Bartek <[email protected]>
Co-authored-by: Bartek <[email protected]>
Co-authored-by: tamirms <[email protected]>
Co-authored-by: George <[email protected]>
Co-authored-by: stfung77 <[email protected]>
Co-authored-by: Leigh McCulloch <[email protected]>
Co-authored-by: Alfonso Acosta <[email protected]>
Co-authored-by: Alfonso Acosta <[email protected]>
Co-authored-by: Graydon Hoare <[email protected]>
Co-authored-by: Satyam Zode <[email protected]>
Co-authored-by: Satyam Zode <[email protected]>
Co-authored-by: erika-sdf <[email protected]>
Co-authored-by: iateadonut <[email protected]>
Co-authored-by: Shawn Reuland <[email protected]>
Co-authored-by: shawn <[email protected]>
Co-authored-by: Shivendra Mishra <[email protected]>
Co-authored-by: Jacek Nykis <[email protected]>
Co-authored-by: jacekn <[email protected]>
Co-authored-by: George Kudrayvtsev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

exp/lighthorizon: Correctly paginate responses to respect query limits
3 participants