drozdziak1/pyth attester rpc timeout fix (#391)

* pyth2wormhole-client: Stagger attestation sched jobs

* pyth2wormhole-client 1.0.0-rc1

This is an initial semver release for the pyth2wormhole-client package.

* p2w_autoattest.py: Add env for atteser --timeout option

* pyth-attesster v1.0.0-rc2

* pyth-attester-v1.0.0-rc3

This fixes a typo in p2w_autoattest.py

* pyth-attester-v1.0.0
This commit is contained in:
Stanisław Drozd 2022-11-18 14:00:44 +01:00 committed by GitHub
parent 9c5425d829
commit b1afaacabf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 4 deletions

View File

@ -2642,7 +2642,7 @@ dependencies = [
[[package]]
name = "pyth2wormhole-client"
version = "0.1.0"
version = "1.0.0-rc3"
dependencies = [
"borsh",
"clap 3.1.18",

View File

@ -1,6 +1,6 @@
[package]
name = "pyth2wormhole-client"
version = "0.1.0"
version = "1.0.0"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -424,7 +424,7 @@ pub async fn crawl_pyth_mapping(
"Mapping: Could not parse account {} as a Pyth mapping, crawling terminated. Error: {:?}",
mapping_addr, e
);
continue;
break;
}
};

View File

@ -551,6 +551,11 @@ async fn attestation_sched_job(args: AttestationSchedJobArgs) -> Result<(), ErrB
message_q_mtx,
} = args;
// Stagger this sched job by batch_no * 10 milliseconds. It
// mitigates uneven distribution of tx requests which may resolve
// RPC timeouts on larger interval-based symbol groups.
tokio::time::sleep(Duration::from_millis(batch_no as u64 * 10)).await;
// Enforces the max batch job count
let sema = Arc::new(Semaphore::new(batch.conditions.max_batch_jobs));
loop {

View File

@ -38,6 +38,9 @@ WORMHOLE_ADDRESS = os.environ.get(
P2W_MAX_LOG_LINES = int(os.environ.get("P2W_MAX_LOG_LINES", 1000))
# attester needs string, but we validate as int first
P2W_RPC_TIMEOUT_SECS = str(int(os.environ.get("P2W_RPC_TIMEOUT_SECS", "20")))
ATTESTATIONS = {
"pendingSeqnos": [],
}
@ -261,6 +264,8 @@ first_attest_result = run_or_die(
"attest",
"-f",
P2W_ATTESTATION_CFG,
"--timeout",
P2W_RPC_TIMEOUT_SECS,
],
capture_output=True,
)
@ -296,6 +301,8 @@ while True:
"-f",
P2W_ATTESTATION_CFG,
"-d",
"--timeout",
P2W_RPC_TIMEOUT_SECS,
],
stdout=PIPE,
stderr=STDOUT,

View File

@ -16,7 +16,7 @@ PYTH_PUBLISHER_KEYPAIR = os.environ.get(
)
# How long to sleep between mock Pyth price updates
PYTH_PUBLISHER_INTERVAL_SECS = float(os.environ.get("PYTH_PUBLISHER_INTERVAL_SECS", "5"))
PYTH_TEST_SYMBOL_COUNT = int(os.environ.get("PYTH_TEST_SYMBOL_COUNT", "9"))
PYTH_TEST_SYMBOL_COUNT = int(os.environ.get("PYTH_TEST_SYMBOL_COUNT", "11"))
# If above 0, adds a new test symbol periodically, waiting at least
# the given number of seconds in between