Skip to content

Commit

Permalink
Fix message assigned
Browse files Browse the repository at this point in the history
  • Loading branch information
jiguantong committed May 16, 2024
1 parent b2217ee commit caa323b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 11 deletions.
6 changes: 6 additions & 0 deletions abis/v2/ORMPAbi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ export const ORMPAbi = [
name: "relayerFee",
type: "uint256",
},
{
indexed: false,
internalType: "bytes",
name: "params",
type: "bytes",
},
],
name: "MessageAssigned",
type: "event",
Expand Down
25 changes: 15 additions & 10 deletions ponder.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { SignaturePubAbi } from "./abis/v2/SignaturePubAbi";

// const INFURA_API_KEY = process.env.INFURA_API_KEY;
const INFURA_API_KEY = null;
const MAX_REQUESTS_PER_SECOND = 8;
const MAX_REQUESTS_PER_SECOND = 5;
const FAST_MAX_REQUESTS_PER_SECOND = 10;
const POLYGON_INFURA_API_KEY = process.env.INFURA_API_KEY;

Expand All @@ -18,9 +18,10 @@ export default createConfig({
transport: http(
INFURA_API_KEY
? `https://arbitrum-sepolia.infura.io/v3/${INFURA_API_KEY}`
: "https://arbitrum-sepolia-rpc.publicnode.com"
// : "https://arbitrum-sepolia-hrpc.vercel.app/"
: "https://sepolia-rollup.arbitrum.io/rpc"
),
maxRequestsPerSecond: FAST_MAX_REQUESTS_PER_SECOND,
maxRequestsPerSecond: MAX_REQUESTS_PER_SECOND,
},
pangolin: {
chainId: 43,
Expand All @@ -37,7 +38,8 @@ export default createConfig({
transport: http(
INFURA_API_KEY
? `https://sepolia.infura.io/v3/${INFURA_API_KEY}`
: "https://ethereum-sepolia-rpc.publicnode.com"
// : "https://sepolia-hrpc.vercel.app/"
: "https://rpc2.sepolia.org"
),
maxRequestsPerSecond: MAX_REQUESTS_PER_SECOND,
},
Expand All @@ -57,7 +59,8 @@ export default createConfig({
transport: http(
INFURA_API_KEY
? `https://arbitrum-mainnet.infura.io/v3/${INFURA_API_KEY}`
: "https://arbitrum-one-rpc.publicnode.com"
: "https://arb1.arbitrum.io/rpc"
// : "https://arbitrum-hrpc.vercel.app/"
),
maxRequestsPerSecond: MAX_REQUESTS_PER_SECOND,
},
Expand All @@ -73,21 +76,22 @@ export default createConfig({
crab: {
chainId: 44,
transport: http("http://c2.crab-rpc.itering.io:9944/"),
// transport: http("https://crab-hrpc.vercel.app/"),
maxRequestsPerSecond: MAX_REQUESTS_PER_SECOND,
},
darwinia: {
chainId: 46,
transport: http("http://c1.darwinia-rpc.itering.io:9944/"),
// transport: http("https://darwinia-hrpc.vercel.app/"),
maxRequestsPerSecond: MAX_REQUESTS_PER_SECOND,
},
ethereum: {
chainId: 1,
transport: http(
// INFURA_API_KEY
// ? `https://mainnet.infura.io/v3/de35badc1ec7472da2967dd0248bd60c`
// : "https://ethereum.publicnode.com"

"https://ethereum-rpc.publicnode.com"
"https://eth-mainnet.public.blastapi.io"
),

maxRequestsPerSecond: MAX_REQUESTS_PER_SECOND,
Expand All @@ -98,6 +102,7 @@ export default createConfig({
POLYGON_INFURA_API_KEY
? `https://polygon-mainnet.infura.io/v3/${POLYGON_INFURA_API_KEY}`
: "https://polygon-bor-rpc.publicnode.com"
// : "https://polygon-hrpc.vercel.app/"
),
maxRequestsPerSecond: MAX_REQUESTS_PER_SECOND,
},
Expand All @@ -117,10 +122,10 @@ export default createConfig({
address: "0xE46ed7594fFa6AD7c3b5232827EC2AF8f94beb38",
},
sepolia: {
startBlock: 5877944,
startBlock: 5906285,
},
arbitrum_sepolia: {
startBlock: 42771116,
startBlock: 43844267,
},
taiko_hekla: {
startBlock: 113905,
Expand All @@ -145,7 +150,7 @@ export default createConfig({
address: "0xb2aa34fde97ffdb6197dd5a2be23c2121405cc12",
network: {
darwinia: {
startBlock: 2667533,
startBlock: 2703000,
},
},
},
Expand Down
12 changes: 11 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const listenOracle = [
const listenSignature = [
"0xdf7b91c92Ac62447Ccb92bd39f41727466534043",
"0x13c991C5BEf30c0E8600D95B8554B4DeDa4853b8", // tron
"0xE46ed7594fFa6AD7c3b5232827EC2AF8f94beb38" // pangoro
"0xE46ed7594fFa6AD7c3b5232827EC2AF8f94beb38", // pangoro
];

ponder.on("ORMPV2:MessageAccepted", async ({ event, context }) => {
Expand Down Expand Up @@ -72,6 +72,11 @@ ponder.on("ORMPV2:MessageAssigned", async ({ event, context }) => {
relayerFee: event.args.relayerFee,
},
});
// console.log(
// event.args.relayer,
// listenRelayer.includes(event.args.relayer),
// context.network.name
// );
// filter other relayer
if (listenRelayer.includes(event.args.relayer)) {
await MessageAcceptedV2.updateMany({
Expand All @@ -88,6 +93,11 @@ ponder.on("ORMPV2:MessageAssigned", async ({ event, context }) => {
},
});
}
// console.log(
// event.args.oracle,
// listenRelayer.includes(event.args.oracle),
// context.network.name
// );
// filter other oracle
if (listenOracle.includes(event.args.oracle)) {
await MessageAcceptedV2.updateMany({
Expand Down

0 comments on commit caa323b

Please sign in to comment.