Skip to content

Commit 967f7bb

Browse files
committed
Merge branch 'main' into explorer-apis
2 parents e908da0 + 24149db commit 967f7bb

File tree

91 files changed

+5321
-1848
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+5321
-1848
lines changed

apps/api-reference/vercel.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
22
"$schema": "https://openapi.vercel.sh/vercel.json",
3-
"ignoreCommand": "../../vercel-ignore.sh",
43
"buildCommand": "turbo run build:vercel --filter @pythnetwork/api-reference"
54
}

apps/entropy-debugger/vercel.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"$schema": "https://openapi.vercel.sh/vercel.json",
3-
"ignoreCommand": "../../vercel-ignore.sh"
2+
"$schema": "https://openapi.vercel.sh/vercel.json"
43
}

apps/entropy-explorer/next.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
const config = {
2+
experimental: {
3+
reactCompiler: true,
4+
},
5+
26
reactStrictMode: true,
37

48
pageExtensions: ["ts", "tsx", "mdx"],

apps/entropy-explorer/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"@types/react": "catalog:",
4646
"@types/react-dom": "catalog:",
4747
"autoprefixer": "catalog:",
48+
"babel-plugin-react-compiler": "catalog:",
4849
"eslint": "catalog:",
4950
"jest": "catalog:",
5051
"postcss": "catalog:",

apps/entropy-explorer/src/components/Home/chain-select.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const useResolvedProps = () => {
9696
textValue: chainTextValue,
9797
buttonLabel: viemChain?.name ?? "Chain",
9898
...(viemChain && {
99-
icon: () => <ChainIcon id={viemChain.id} />,
99+
icon: <ChainIcon id={viemChain.id} />,
100100
}),
101101
};
102102
};

apps/entropy-explorer/src/components/Home/request-drawer.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ const RequestDrawerBody = ({ request }: { request: Request }) => {
6565
label="Details"
6666
fill
6767
className={styles.details ?? ""}
68-
stickyHeader
6968
columns={[
7069
{
7170
id: "field",
@@ -254,7 +253,7 @@ const CallbackFailedInfo = ({ request }: { request: CallbackErrorRequest }) => {
254253
<Button
255254
size="sm"
256255
variant="ghost"
257-
beforeIcon={Question}
256+
beforeIcon={<Question />}
258257
rounded
259258
hideText
260259
href="https://docs.pyth.network/entropy/debug-callback-failures"

apps/entropy-explorer/src/components/Home/results.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ const defaultProps = {
207207
label: "Requests",
208208
rounded: true,
209209
fill: true,
210+
stickyHeader: "appHeader",
210211
columns: [
211212
{
212213
id: "chain" as const,

apps/entropy-explorer/vercel.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
22
"$schema": "https://openapi.vercel.sh/vercel.json",
3-
"ignoreCommand": "../../vercel-ignore.sh",
43
"buildCommand": "turbo run build:vercel --filter @pythnetwork/entropy-explorer"
54
}

apps/fortuna/src/command/run.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ pub async fn run(opts: &RunOptions) -> Result<()> {
105105
));
106106
let history = Arc::new(History::new().await?);
107107
for (chain_id, chain_config) in config.chains.clone() {
108+
keeper_metrics.add_chain(chain_id.clone(), config.provider.address);
108109
let keeper_metrics = keeper_metrics.clone();
109110
let keeper_private_key_option = keeper_private_key_option.clone();
110111
let chains = chains.clone();
@@ -184,7 +185,6 @@ async fn setup_chain_and_run_keeper(
184185
rpc_metrics.clone(),
185186
)
186187
.await?;
187-
keeper_metrics.add_chain(chain_id.clone(), state.provider_address);
188188
chains.write().await.insert(
189189
chain_id.clone(),
190190
ApiBlockChainState::Initialized(state.clone()),

apps/fortuna/src/keeper.rs

Lines changed: 49 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -179,45 +179,56 @@ pub async fn run_keeper_threads(
179179
};
180180

181181
loop {
182-
// There isn't a loop for indefinite trials. There is a new thread being spawned every `TRACK_INTERVAL` seconds.
183-
// If rpc start fails all of these threads will just exit, instead of retrying.
184-
// We are tracking rpc failures elsewhere, so it's fine.
185-
spawn(
186-
track_provider(
187-
chain_id.clone(),
188-
contract.clone(),
189-
provider_address,
190-
keeper_metrics.clone(),
191-
)
192-
.in_current_span(),
193-
);
194-
spawn(
195-
track_balance(
196-
chain_id.clone(),
197-
contract.client(),
198-
keeper_address,
199-
keeper_metrics.clone(),
200-
)
201-
.in_current_span(),
202-
);
203-
spawn(
204-
track_accrued_pyth_fees(
205-
chain_id.clone(),
206-
contract.clone(),
207-
keeper_metrics.clone(),
208-
)
209-
.in_current_span(),
210-
);
211-
spawn(
212-
track_block_timestamp_lag(
213-
chain_id.clone(),
214-
contract.client(),
215-
keeper_metrics.clone(),
216-
)
217-
.in_current_span(),
218-
);
219-
220182
time::sleep(TRACK_INTERVAL).await;
183+
184+
// Track provider info and balance sequentially. Note that the tracking is done sequentially with the
185+
// timestamp last. If there is a persistent error in any of these methods, the timestamp will lag behind
186+
// current time and trigger an alert.
187+
if let Err(e) = track_provider(
188+
chain_id.clone(),
189+
contract.clone(),
190+
provider_address,
191+
keeper_metrics.clone(),
192+
)
193+
.await
194+
{
195+
tracing::error!("Error tracking provider: {:?}", e);
196+
continue;
197+
}
198+
199+
if let Err(e) = track_balance(
200+
chain_id.clone(),
201+
contract.client(),
202+
keeper_address,
203+
keeper_metrics.clone(),
204+
)
205+
.await
206+
{
207+
tracing::error!("Error tracking balance: {:?}", e);
208+
continue;
209+
}
210+
211+
if let Err(e) = track_accrued_pyth_fees(
212+
chain_id.clone(),
213+
contract.clone(),
214+
keeper_metrics.clone(),
215+
)
216+
.await
217+
{
218+
tracing::error!("Error tracking accrued pyth fees: {:?}", e);
219+
continue;
220+
}
221+
222+
if let Err(e) = track_block_timestamp_lag(
223+
chain_id.clone(),
224+
contract.client(),
225+
keeper_metrics.clone(),
226+
)
227+
.await
228+
{
229+
tracing::error!("Error tracking block timestamp lag: {:?}", e);
230+
continue;
231+
}
221232
}
222233
}
223234
.in_current_span(),

0 commit comments

Comments
 (0)