-
Notifications
You must be signed in to change notification settings - Fork 72
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
Heartbeat data #1415
Heartbeat data #1415
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but two comments.
(And of course it lost my other comment):
The airnode address shouldn't be necessary because it can be extracted from the signature:
const msg = "Hallo Welt";
const signature = await owner.signMessage(msg);
const signer = ethers.utils.verifyMessage(msg, signature);
expect(signer).to.equal(owner.address);
maybe @aTeoke can comment on where the requirement came from/if there's a specific reason the airnode address is needed in the payload too? :)
I might be misunderstanding what you mean, but won't chainAPI need the |
Their API can extract the airnode address from the signature, so you don't need an extra field. To rephrase: ChainAPI will receive a heartbeat containing a heartbeat payload and a signature. They'll start by verifying the signature against the payload and in the process they will also recover the const ethers = require('ethers');
const msg = "Hello world";
const randomWallet = ethers.Wallet.createRandom();
const signedMessage = await randomWallet.signMessage(msg);
const recoveredKey = ethers.utils.verifyMessage(msg, signedMessage);
// recoveredKey here was '0x36e56E09214926aF279ce1a6392d58e246538afa'
if (recoveredKey === randomWallet.address) console.log('Addresses match'); |
Thanks for explaining, in this case I am also not sure why it was originally included in the payload 🤔 |
I think I've created the confusion here. Sorry about that 😅 |
50841e9
to
8c92bf1
Compare
* Add heartbeat signing * Add changeset * Use timestamp in heartbeat signature * Add airnode_address, cloud_provider, stage, region to heartbeat payload * Add changeset * Remove airnode_address from heartbeat payload * Fix martin github account
* Avoid constants with side effects (#1394) * Remove constants test * Fix flaky test One of the unsafe evaluate test is flaky because the setInterval used internally might be potentially be called 4 times until the evaluation is suspended by the node VM. This fix is to change the tick period to make this even less probable. * Use API_CALL_TIMEOUT constant in tests * Remove API_CALL_TOTAL_TIMEOUT * Add worker timeout test * Refactor airnode-utilities timeouts * Rename default timeout to default blockchain call timeout * Add changeset * Fix lint * Remove unused delay configuration for deployer handlers * Merge pull request #1396 from api3dao/remove-heartbeatId Remove heartbeatId * Heartbeat signature (#1398) * Add heartbeat signing * Add changeset * Use timestamp in heartbeat signature * Heartbeat data (#1415) * Add heartbeat signing * Add changeset * Use timestamp in heartbeat signature * Add airnode_address, cloud_provider, stage, region to heartbeat payload * Add changeset * Remove airnode_address from heartbeat payload * Fix martin github account * Move from API keys to route-based authentication for HTTP gateways (#1418) * Remove gateway keys from validator and configs * Remove gateway keys from local handlers, examples, request headers, gcp verification * Add gateway path_key uuid to deployer, terraform and openapi templates * Add pathKey to local gateway server * Remove unused path_key variable from terraform, add uuid to local gateway docs, fix example secrets file, fix openApi template paths * Increase npm registry ping delay * Fix GCP gateway output url * Generate gateway uuid with terraform random_uuid * Uuse constant pathKey in local gateways * Merge branch temp-v0.10.0 into remove-gateway-api-keys * Update local gateway pathKey constant * Fix lint and tests Co-authored-by: vponline <[email protected]>
Closes #1411