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

feat: combine signatures into gateway batch #153

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

deanamiel
Copy link
Contributor

@deanamiel deanamiel commented Jan 17, 2024

Draft PR for manually combining validator signatures into gateway batch as per AXE-2733

@deanamiel deanamiel requested a review from a team as a code owner January 17, 2024 08:33
evm/combine-signatures.js Outdated Show resolved Hide resolved
evm/utils.js Outdated Show resolved Hide resolved
Copy link
Contributor

@blockchainguyy blockchainguyy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have added small comments, still need to test it.

re1ro
re1ro previously approved these changes Jan 29, 2024
evm/combine-signatures.js Outdated Show resolved Hide resolved
for (const signatureJSON of sortedSignatures) {
const keyId = signatureJSON.key_id;
const msgHash = `0x${signatureJSON.msg_hash}`;
const pubKey = `0x${signatureJSON.pub_key}`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verify that pub key matches the validator address in the file as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const validatorWeight = validatorWeights[validatorAddress.toLowerCase()];

if (!validatorWeight) {
    printError('Validator does not belong to current epoch', validatorAddress);
    return;
}

This check should ensure that all the validator public keys correspond to valid validators in the current epoch

evm/combine-signatures.js Outdated Show resolved Hide resolved
evm/combine-signatures.js Outdated Show resolved Hide resolved
evm/combine-signatures.js Show resolved Hide resolved
evm/combine-signatures.js Outdated Show resolved Hide resolved
evm/combine-signatures.js Show resolved Hide resolved
evm/combine-signatures.js Show resolved Hide resolved
evm/combine-signatures.js Outdated Show resolved Hide resolved
evm/README.md Show resolved Hide resolved
evm/README.md Show resolved Hide resolved
kubectl exec -ti axelar-core-node-validator1-5b68db5c49-mf5q6 -n stagenet-validator1 -c vald -- sh
```

7. Within the validator container, run the vald command from step 2 with the correct validator address. Validator addresses can be found by appending this endpoint `/axelar/multisig/v1beta1/key?key_id=[KEY_ID]` to the Axelar lcd url in the chains config file. Running this command should result in a JSON output containing the signature, similar to the example below:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@milapsheth is there a simpler way to identify the validator address of a container than looping through all the validators mentioned in the endpoint. this approach might not be viable on testnet or mainnet.

evm/README.md Show resolved Hide resolved
evm/combine-signatures.js Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants