Skip to content

Commit

Permalink
Dev (#28)
Browse files Browse the repository at this point in the history
* Update readme

* Only saved fee estimates on mined blocks

* Fixes & improvements

* Update stuff

* Prune blocks

* Networks in DB - Handling reorgs (#2)

* Update TODO

* Update TODO

* Allow updating relayers - max inflight txs in relayer

* Start indexing chains at startup

* Estimate block fees in a separate task

* Add support for cross-chain gas price limits

* Cleanup

* Add transaction priority

* Refactor routes

* Fix manual test

* RPC Access

* Minor fixes

* Parallelize broadcast per relayer + error handling

* Expose unsent status

* Update TODO

* Add item to TODO

* Consistent formatting of SQL

* Minor cleanup

* WIP

* Add TODO item

* Add TODO item

* misc

* Section TODO

* Dzejkop/api-keys (#3)

* Dzejkop/dockerize (#4)

* Update API routes

* Log more

* Save all txs

* Fetch block hashes

* Update AWS libs

* Minor fixes

* Build and push image

* Allow parts for db settings

* Prefetch deps + use sparse registries + log connection string

* Add GH actions

* Enable auth for admin routes

* Speed up tests

* Install foundry for tests

* Add health endpoint

* Fix anvil issue

* Cache dependencies in docker builds

* Remove secrets leak

* Use cache

* Use buildx

* Add clippy

* Add getTxs endpoint

* WIP: Integrate telemetry-batteries

* Change service tag

* Update telemetry-batteries

* fmt

* Don't destroy the db

* Remove redundant relayer id

* Try unnested fields

* Use new telemetry-batteries

* Fix

* Emit metrics periodically

* Fix get_txs bug

* misc

* Big query & mining metrics

* More logging & metrics

* Fix escalation fee logic

* fmt

* Metrics for gas

* Better logging

* Add tx created log

* Add relayers endpoint

* Fix

* Fix race condition

* Add relayer reset endpoint

* Fix

* Fix

* Fix

* Remove hard coded gas limit

* Remove surge logic

* added .gitignore, increased allowable db setup time

* fix: typo

* Make transfers in tests more parallel

* updated logic to back fill blocks that have been missed

* adding comments

* updated tests

* updated get_latest_block_number

* updated comments

* cargo clippy

* Preconfigured start - for dockerization (#6)

* Allow preconfigured networks & relayers

* Only allow single network and relayer

* Allow filtering txs by status (#7)

* Allow filtering txs by status

* Minor refactor

* insert into tx_hashes and sent_transactions seperatley, added raw_signed_tx for UniversalSigner

* Example .env

* Fix

* added logic to recover simulated txs

* cargo clippy, cargo sort

* formatting

* removed recover simulated tx

* updated insert_into_tx_hashes to do nothing on conflict

* on conflict, update tx_hashes

* updated tx_hashes to add constraint on tx_id, do nothing on conflict when inserting into table

* added insert_tx_broadcast

* write to database after successful simulation

* removed unneeded function

* updated cargo toml to match dev branch

* removed comments and todo

* Build for multiple platforms

* Don't build for arm/v7

* Tags

* TEMP: Don't build for arm64

* Bring back arm64

* Update action versions

* Add annotations

* No more matrix

* Remove matrix reference

* Reorg & Escalation testing (#11)

* Further dockerization support (#12)

* Predefined api key for dockerization

* Fix Dockerfile

* Fix owned deserialization (#13)

* Allow disabling relayers (#14)

* Update DB

* Integrate with db code

* Escalate per relayer & don't if relayer disabled

* clippy

* Improve-logging (#15)

* Improve logging

* Clippy & fmt

* Minor improvements

* Remove redundant comment

* instrument db txs (#19)

* Api Key Rework - PRO-467 (#17)

* shortened api key and fixed predefined toml

* dynamic length api key

* Fix for security issue where api keys were being exposed in logs and traces

* redact api key (#20)

* update tel batteries (#21)

* Remove transaction simulation (#22)

* More instrumentation

* Docker compose setup

* Misc

* Additional logs

* More logs

* Abort on panic + better instrumentation

* Fix escalation fees calculation logic

* Bring back metrics (#24)

* Config sanity check

* Add max_queued_txs

* Update metrics

* Cleanup Cargo.toml

* Add log to start service

* Revert "Add max_queued_txs"

This reverts commit 83c517d.

* Add shutdown listening (non-graceful)

* clippy + fmt

* Fix telemetry issues (#27)

* Fix telemetry issues

* Update dep

* Add max_queued_txs column + minor client improvement (#25)

* Add max_queued_txs column

* Implement logic (WIP)

* Serialize errors

* Update errors in client + update logic

* Instrument remaining db methods + fix

* Fix in code condition

* Reenable test

* Fix and refactor tests

---------

Co-authored-by: 0xKitsune <[email protected]>
Co-authored-by: 0xKitsune <[email protected]>
Co-authored-by: Eric Woolsey <[email protected]>
  • Loading branch information
4 people authored Mar 19, 2024
1 parent fe583bf commit f2bd5bf
Show file tree
Hide file tree
Showing 69 changed files with 5,749 additions and 1,838 deletions.
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[registries.crates-io]
protocol = "sparse"
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
target/
.git
README.md
TODO.md
manual_test.nu
config.toml
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
RUST_LOG=info,tx_sitter=debug,fake_rpc=debug,tower_http=debug
53 changes: 53 additions & 0 deletions .github/workflows/build-image-and-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build and Publish Docker Image

on:
push:
branches: [ main, dev ]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Check Out Repo
uses: actions/checkout@v4

- name: Log in to Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha
type=raw,value=latest
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
annotations: ${{ steps.meta.outputs.annotations }}
cache-from: type=gha
cache-to: type=gha,mode=max
33 changes: 33 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Run tests"
on:
push:
pull_request:

jobs:
test:
name: cargo test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install latest nextest release
uses: taiki-e/install-action@nextest
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- run: cargo nextest run --workspace
env:
RUST_LOG: info,tx-sitter=debug
- run: cargo clippy --workspace --tests

formatting:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt
- name: Rustfmt Check
uses: actions-rust-lang/rustfmt@v1
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target/
.env
Loading

0 comments on commit f2bd5bf

Please sign in to comment.