Skip to content

Commit

Permalink
[PROTO-1478] Add finalPOABlock support to discovery relay (#6861)
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondjacobson authored Dec 6, 2023
1 parent e57b781 commit 3a390a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export type Config = {
aao: AntiAbuseConfig;
rateLimitAllowList: string[];
rateLimitBlockList: string[];
finalPoaBlock: number;
};

// reads .env file based on environment
Expand All @@ -46,6 +47,7 @@ export const readConfig = (): Config => {
audius_use_aao: bool({ default: false }),
relay_server_host: str({ default: "0.0.0.0" }),
relay_server_port: num({ default: 6001 }),
audius_final_poa_block: num({ default: 0 })
});
return {
environment: env.audius_discprov_env,
Expand All @@ -59,5 +61,6 @@ export const readConfig = (): Config => {
aao: newAntiAbuseConfig(env.audius_aao_endpoint, env.audius_use_aao),
rateLimitAllowList: allowListPublicKeys(),
rateLimitBlockList: blockListPublicKeys(),
finalPoaBlock: env.audius_final_poa_block
};
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { wallets, web3 } from ".";
import { config, wallets, web3 } from ".";
import { internalError } from "./error";
import { logger } from "./logger";
import { confirm } from "./web3";
Expand Down Expand Up @@ -42,6 +42,7 @@ export const relayTransaction = async (
// query chain until tx is mined
try {
const receipt = await confirm(submit.hash);
receipt.blockNumber += config.finalPoaBlock
res.send({ receipt });
} catch (e) {
internalError(next, e as string);
Expand Down

0 comments on commit 3a390a7

Please sign in to comment.