Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validatorRelayer daemon stalled with no error #46

Open
juehai opened this issue Jan 10, 2022 · 0 comments
Open

validatorRelayer daemon stalled with no error #46

juehai opened this issue Jan 10, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@juehai
Copy link
Contributor

juehai commented Jan 10, 2022

run-command: yarn validatorRelayer $ETH_NETWORK

The daemon was stalled and stopped printing new blocknumber like 1641852906 At blocknumber: 10937741 {}.

Could we add a try/catch for below functions, it seems that the logger printed At blocknumber and then hang forever.

Two potential calling functions caused this:

  1. await api.rpc.chain.subscribeFinalizedHeads failed, and did not catch the error
  2. await api.query.system.events.at(blockHash); failed, and did not catch the error
    await api.rpc.chain
        .subscribeFinalizedHeads(async (head) => {
            const blockNumber = head.number.toNumber();
            logger.info(`At blocknumber: ${blockNumber}`);

            const blockHash = head.hash.toString();
            const events = await api.query.system.events.at(blockHash);
            events.map(async ({event}) => {
                const { section, method, data } = event;
                if (section === 'ethBridge' && method === 'AuthoritySetChange') {
                    const dataFetched = data.toHuman();
                    const eventIdFound = dataFetched[0];
                    const newValidatorSetId = parseInt(dataFetched[1]);
                    logger.info(`IMP Event found at block ${blockNumber} hash ${blockHash} event id ${eventIdFound}`);
                    await getEventPoofAndSubmit(api, eventIdFound, bridge, wallet, newValidatorSetId.toString(), blockHash, infuraProvider);
                }
            })
        });
@jordy25519 jordy25519 added the bug Something isn't working label Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants