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

fix: 1559 transaction handling #551

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

Conversation

ganchoradkov
Copy link
Member

The current validation of eth_signTransaction result is not sufficient for handling 1559 responses

Copy link

vercel bot commented Apr 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
decentralized-relay-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 30, 2024 2:02pm
malicious-dapp-verify-simulation ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 30, 2024 2:02pm
react-dapp-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 30, 2024 2:02pm
9 Ignored Deployments
Name Status Preview Comments Updated (UTC)
decentralized-relay-wallet ⬜️ Ignored (Inspect) Visit Preview Apr 30, 2024 2:02pm
react-auth-dapp ⬜️ Ignored (Inspect) Visit Preview Apr 30, 2024 2:02pm
react-auth-wallet ⬜️ Ignored (Inspect) Visit Preview Apr 30, 2024 2:02pm
react-dapp-v2-cosmos-provider ⬜️ Ignored (Inspect) Visit Preview Apr 30, 2024 2:02pm
react-dapp-v2-with-ethers ⬜️ Ignored (Inspect) Visit Preview Apr 30, 2024 2:02pm
react-dapp-v2-with-web3js ⬜️ Ignored (Inspect) Visit Preview Apr 30, 2024 2:02pm
react-wallet-v2 ⬜️ Ignored (Inspect) Visit Preview Apr 30, 2024 2:02pm
svelte-web3modal ⬜️ Ignored (Inspect) Visit Preview Apr 30, 2024 2:02pm
vue-dapp-auth ⬜️ Ignored (Inspect) Visit Preview Apr 30, 2024 2:02pm

Copy link
Member

@bkrem bkrem left a comment

Choose a reason for hiding this comment

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

Thanks for fixing the sig validation 🙏

const CELO_ALFAJORES_CHAIN_ID = 44787;
const CELO_MAINNET_CHAIN_ID = 42220;

let valid = false;
console.log("rpc request", {
Copy link
Member

Choose a reason for hiding this comment

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

Needed?

const transaction = ethers.utils.parseTransaction(
signedTx.startsWith("0x") ? signedTx : `0x${signedTx}`
);
console.log("parsed transaction", transaction);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
console.log("parsed transaction", transaction);

signedTx as any
).verifySignature();
} catch (e) {
console.warn("fromSerializedTx failed", e);
Copy link
Member

Choose a reason for hiding this comment

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

Should be error since this is a failure case?

Suggested change
console.warn("fromSerializedTx failed", e);
console.error("fromSerializedTx failed", e);

transaction.to === tx.to &&
transaction.from === tx.from;
} catch (e) {
console.warn("parseTransaction failed", e);
Copy link
Member

Choose a reason for hiding this comment

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

Should be an error because it's a failure case not a warning that can be ignored:

Suggested change
console.warn("parseTransaction failed", e);
console.error("parseTransaction failed", e);

@bkrem
Copy link
Member

bkrem commented May 2, 2024

@ganchoradkov can we fix up and merge?

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.

2 participants