audius-protocol
audius-protocol copied to clipboard
Fixes for audio transaction history backfilling
Description
Fixes 2 major bugs in audio_transactions_history table backfilling (which are unfortunately already deployed):
- Lock timeouts - originally there was a timeout on the indexing task lock which would allow a new task to grab the lock and begin indexing the same data. This would result in a race condition - one task would write out data to
audio_transactions_history
and whatever backfilling txs table it was using, then the other would try to write duplicate data and fail. Solution was to remove the timeouts. - Solana flakiness - calls to
get_signatures_for_address
was returning an empty list even though there were definitely prior signatures for the given program, even after increasing retries 10x. The indexer logic would erroneously treat this as the "beginning of time" for that program, and stop indexing at that point resulting in sometimes huge gaps in the indexed data. The solution was to hardcode themin_sig
value (lowest known signature for the program) and check against that - if we encountered an empty list when we shouldn't have, fail out and restart the task. - Another small bug was a
KeyError
inhelpers.py
- switched to a for loop instead of usingnext
.
Also added a db migration to delete all data associated with the backfilling so we can have a fresh start.
Tests
Tested on remote-dev with 3 DNs this time so we can check data consistency between them. Also tested on a prod sandbox.
Monitoring - How will this change be monitored? Are there sufficient logs / alerts?
Lots of logs, also switched to logger.info
in index_spl_token_backfill.py
for better visibility.
⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.
Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.
🔎 Detected hardcoded secret in your pull request
GitGuardian id | Secret | Commit | Filename | |
---|---|---|---|---|
5071455 | Generic High Entropy Secret | 39313655eff0e88e74c94249c566a22e213310cc | discovery-provider/default_config.ini | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Our GitHub checks need improvements? Share your feedbacks!
@dharit-tan do we care about this PR still?
@dharit-tan do we care about this PR still?
Nope, this code is deleted!