api3dao / airnode

Airnode monorepo
https://docs.api3.org/
MIT License
160 stars 66 forks source link

Ignore casing when comparing address in OEV gateway #1963

Closed Siegrift closed 1 month ago

Siegrift commented 4 months ago

Here we should make sure to allow comparing EIP-55 address with lowercase one.

dcroote commented 4 months ago

Here as well? https://github.com/api3dao/airnode/blob/1c49d6fe602eb430093a73f8339ec0034afdbcae/packages/airnode-node/src/handlers/sign-oev-data.ts#L15

Though I'm actually having a hard time understanding how both addresses can be anything but Checksum addresses in the code you linked to:

https://github.com/api3dao/airnode/blob/1c49d6fe602eb430093a73f8339ec0034afdbcae/packages/airnode-node/src/workers/local-gateways/validation.ts#L277-L279

Here, airnodeAddress is the Checksum address since that is what ethers within getAirnodeWalletFromPrivateKey() returns. As for beacon.airnodeAddress, it seems this too has to be the Checksum address, since otherwise ethers verifyMessage would fail because the signature, generated with ethers signMessage (right?), returns the Checksum address.

https://github.com/api3dao/airnode/blob/1c49d6fe602eb430093a73f8339ec0034afdbcae/packages/airnode-node/src/workers/local-gateways/validation.ts#L177-L182

Siegrift commented 3 months ago

I actually wasn't sure just by looking at the code, so I assumed this is possible. If you've verified this is not an issue we can close this one.

Siegrift commented 1 month ago

I believe this works as expected.