- Previous setup would fail if there were no headers in the db. This
makes sense because we need headers that haven't been checked for
logs to exist so that we can fetch logs for those headers. But it
also prevents us from kicking off the headerSync and contractWatcher
processes concurrently. These changes enable kicking off both
processes at the same time with the idea that we will have unchecked
headers upon transformer execution.
* Factor out get or create address into one sql string
* Factor out getChecksumAddress method in address repo
* Update address repo methods to not need a receiver
* Move address repository to libraries/shared
- Focus on header mode
- Add context to errors, trace guard clauses, warn on non-returned
errors
- Give errors distinct names so compiler will recognize if unchecked
- Remove redundant type declarations/fix typos
- Previously, we required that the first missing header match the
configured starting block number. This helps guarantee that we have
the necessary data for method polling in memory, but prevents the
process from moving forward if restarted after the starting block
has already been checked.
- Prevents duplicate key constraint violation from blocking the process
from moving forward on restart.
- If header_id, log_idx, and tx_idx are the same, we can safely do
nothing since it's definitely the same log - a reorg would cause the
original header to be replaced with a new ID.
- If a header was marked as checked before a transformer was added to
the watcher, mark all headers since the new transformer's starting
block number as unchecked.
- limit missing headers results set to 100 so that extraction doesn't
excessively block delegation
- wrap checked headers functions in repository struct
- move storage repository to factory, to correspond with event
repository path
- remove unused files
- reformat sql
- remove line breaks in imports
- enables decoupling event extraction/persistence from transformation
- modifies event transformer, converter, and log chunker to accept
payload that includes internal log database ID with log data
- remove alias for transformer pkg as shared_t
- remove unused mock watcher repository