go
go copied to clipboard
Fix separation of concerns in Horizon processors
Currently, many Horizon processors are relying on db2/history package to do parts of ingestion. db2/history methods should be dumb: they should accept struct to insert/update in a DB and do nothing else. Doing this will make code and tests simpler and will allow writing fuzzers with a mocked DBs.
While working on this we can fix existing issues related to using maps instead of structs: https://github.com/stellar/go/issues/2578.
Examples:
- One striking example is
TransactionProcessorthat delegates all ingesting code toTransactionBatchInsertBuilder. - Example fix (of
OffersProcessor): https://github.com/stellar/go/pull/3083.
List of processors to fix:
- [x] OffersProcessor
- [x] https://github.com/stellar/go/issues/3935
- [x] https://github.com/stellar/go/issues/3934
- [ ] AssetStatsProcessor
- [x] https://github.com/stellar/go/issues/3936
- [ ] EffectProcessor
- [ ] LedgersProcessor
- [ ] OperationProcessor
- [ ] ParticipantsProcessor
- [ ] SignersProcessor
- [ ] TradeProcessor
- [ ] TransactionProcessor
- [x] TrustLinesProcessor
- [x] LiquidityPoolsProcessor