Skip to content

Commit

Permalink
Merge pull request #114 from onomyprotocol/release-build-fix
Browse files Browse the repository at this point in the history
fix: release build fix
  • Loading branch information
cgdusek authored Nov 3, 2022
2 parents 56fe88d + c5e764a commit 0c67280
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/automated-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,14 @@ jobs:
# entry is already made and rust builds take nearly 10 minutes, so instead
# of having a workable release in 20 minutes we can have one in 10 with the ARM
# binaries coming 10 minutes later.

# because of https://github.com/cross-rs/cross/issues/724
# we have to run `cargo clean` between targets

- name: Build GBT ARM64
run: |
cd orchestrator
cargo clean
cross build --target aarch64-unknown-linux-musl --release --all
- name: Upload Gravity Bridge Tools ARM
Expand All @@ -233,6 +238,7 @@ jobs:
- name: Build GBT Windows
run: |
cd orchestrator
cargo clean
cross build --target x86_64-pc-windows-gnu --release --all
- name: Upload Gravity Bridge Tools Windows
Expand Down Expand Up @@ -268,6 +274,7 @@ jobs:
UNATTENDED=yes OSX_VERSION_MIN=10.7 ./build.sh
popd
cd orchestrator
cargo clean
PATH="/tmp/osxcross/target/bin:$PATH" \
CC=o64-clang \
CXX=o64-clang++ \
Expand Down
6 changes: 4 additions & 2 deletions orchestrator/orchestrator/src/ethereum_event_watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ pub async fn check_for_events(
let our_cosmos_address = our_private_key.to_address(&contact.get_prefix()).unwrap();

let ending_block = if USE_FINALIZATION {
// get this first in case inbetween the calls is a block boundary
// don't accidentally use this variable elswhere
let unsafe_latest_block = get_latest_block_number_with_retry(web3).await;

// NOTE: the delay can only be omitted if we are using the `finalized` version on a PoS network
let finalized_block = get_finalized_block_number_with_retry(web3).await;

let expected_delay = get_expected_block_delay(web3).await;

// don't accidentally use this variable elswhere
let unsafe_latest_block = get_latest_block_number_with_retry(web3).await;
// do this even if `expected_delay` is zero, be extra paranoid
if finalized_block.checked_add(expected_delay).unwrap() > unsafe_latest_block {
return Err(GravityError::UnrecoverableError(format!(
Expand Down

0 comments on commit 0c67280

Please sign in to comment.