-
Notifications
You must be signed in to change notification settings - Fork 26
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
Intermittent "invalid point" error when signing a transaction #5
Comments
The package dependencies are as follows. I restricted ethers and kms to the versions ethers-gcp-kms-signer 1.1.2 specifies, but that didn't make any difference.
|
I had switched to 1.1.1, but now it's failing with that too, in the same way, about 50% of the time. |
I'm running Node v14.20.0. FYI yarn complains about |
I was able to reproduce the problem in the current repository, by adding this to test("should sign a transaction", async () => {
const provider = ethers.providers.InfuraProvider.getWebSocketProvider("rinkeby", process.env.INFURA_KEY);
const signer = new GcpKmsSigner(kmsCredentials).connect(provider);
const tx = await signer.signTransaction({
to: "0xEd7B3f2902f2E1B17B027bD0c125B674d293bDA0",
value: ethers.utils.parseEther("0.001"),
});
expect(tx).not.toBeNull();
/* eslint-disable no-console */
console.log(tx);
}); |
hey @nedgar . Thanks for flagging this. |
@fforbeck Thanks, the Or perhaps we can just add an API function that checks whether the algorithm for a given key is compatible? |
@nedgar yeah, that's the algo Ethereum uses. Good point, I believe if we implement your suggestion from #6 (instantiating the kms client only once) we reduce the leak, and we can execute an additional call to get the configs (kms.getCryptoKeyVersion) to verify if it is using the correct algorithm. If I remember correctly, the |
That sounds good, I’ll work on a PR in the coming week. For now, I just moved the kms const assignment outside the functions.
…On Aug 10, 2022, 9:26 AM -0400, Felipe Forbeck ***@***.***>, wrote:
@nedgar yeah, that's the algo Ethereum uses. Good point, I believe if we implement your suggestion from #6 (instantiating the kms client only once) we reduce the leak, and we can execute an additional call to get the configs (kms.getCryptoKeyVersion) to verify if it is using the correct algorithm. If I remember correctly, the kms.getPublicKey also returns the algo, but we are not checking that. Feel free to submit a PR with these changes, happy to review that.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I'm getting frequent yet intermittent "invalid point" errors when using v1.1.2 to sign a transaction.
The signing algorithm for the asymmetric signing key in GCP KMS is Elliptic Curve P-256 / SHA256 -- using either version 1 or 2 here (version 3 was just to test, not being used):
The code derived from the example in the README:
When it fails, the stack is:
Yesterday this was happening 80-90% of the time. Today I haven't been able to reproduce it. Very odd.
The text was updated successfully, but these errors were encountered: