Skip to content

Commit 6540059

Browse files
committed
improve: Clean up Constants file
# Motivation Optimism Bedrock upgrade means that we should change some assumptions about how Optimism blocks work. I also used the opportunity to clean up the constants file and update the average Optimism block time assumption in this PR UMAprotocol/protocol#4573
1 parent 9a2788f commit 6540059

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/common/Constants.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,6 @@ export const RELAYER_MIN_FEE_PCT = 0.0003;
1717
// Target ~4 hours
1818
export const MAX_RELAYER_DEPOSIT_LOOK_BACK = 4 * 60 * 60;
1919

20-
// Target ~4 days per chain. Should cover all events needed to construct pending bundle.
21-
export const DATAWORKER_FAST_LOOKBACK: { [chainId: number]: number } = {
22-
1: 28800,
23-
10: 1382400,
24-
137: 138240,
25-
288: 11520,
26-
42161: 1382400,
27-
};
28-
2920
// Target ~14 days per chain. Should cover all events that could be finalized, so 2x the optimistic
3021
// rollup challenge period seems safe.
3122
export const FINALIZER_TOKENBRIDGE_LOOKBACK = 14 * 24 * 60 * 60;
@@ -48,12 +39,12 @@ export const FINALIZER_TOKENBRIDGE_LOOKBACK = 14 * 24 * 60 * 60;
4839
// - Ethereum: https://etherscan.io/blocks_forked
4940
// - Polygon: https://polygonscan.com/blocks_forked
5041

51-
// Optimistic Rollups are currently centrally serialized and are not expected to reorg. Technically a block on an
42+
// Arbitrum is currently centrally serialized and are not expected to reorg. Technically a block on an
5243
// ORU will not be finalized until after 7 days, so there is little difference in following behind 0 blocks versus
5344
// anything under 7 days.
5445
export const DEFAULT_MIN_DEPOSIT_CONFIRMATIONS = {
5546
1: 64, // Finalized block: https://www.alchemy.com/overviews/ethereum-commitment-levels
56-
10: 0,
47+
10: 120,
5748
137: 128, // Commonly used finality level for CEX's that accept Polygon deposits
5849
288: 0,
5950
42161: 0,
@@ -83,7 +74,8 @@ export const MIN_DEPOSIT_CONFIRMATIONS: { [threshold: number | string]: { [chain
8374
421613: 0,
8475
},
8576
};
86-
export const QUOTE_TIME_BUFFER = 12 * 5; // 5 blocks on Mainnet.
77+
export const QUOTE_TIME_BUFFER = 12 * 5; // 60 seconds. Used to protect relayer from filling deposits with
78+
// quote timestamp this number of seconds older than the latest time.
8779

8880
export const REDIS_URL_DEFAULT = "redis://localhost:6379";
8981

0 commit comments

Comments
 (0)