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

web3.eth.accounts.signTransaction VS EIP-1559 #5141

Closed
1 task done
overdoignism opened this issue Jun 17, 2022 · 8 comments · Fixed by #5121
Closed
1 task done

web3.eth.accounts.signTransaction VS EIP-1559 #5141

overdoignism opened this issue Jun 17, 2022 · 8 comments · Fixed by #5121
Labels
1.x 1.0 related issues Documentation Relates to project wiki or documentation

Comments

@overdoignism
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

What would you like to say about Web3.js' documentation?

When we read the document part for web3.eth.accounts.signTransaction,
There is only have gas and gas price, no max priority, no max fee.

May you update this part document for support EIP-1559?
Or it need to update the API library code?

Thanks.

Examples/References

No response

@overdoignism overdoignism added the Documentation Relates to project wiki or documentation label Jun 17, 2022
@overdoignism
Copy link
Author

BTW, When I am using the maxFeePerGas and maxPriorityFeePerGas with gasPrice in web3.eth.accounts.signTransaction (undocumented way)

It will say and error: eip-1559 transactions don't support gasPrice

But if I remove gasPrice , it will execute web3.eth.gasPrice and make me can't sign offline.

Looks like a code problem?

@nikoulai
Copy link
Contributor

nikoulai commented Jun 17, 2022

Hi @overdoignism, thanks for reaching out.

EIP 1559 is supported by web3js, however, gasPrice shouldn't be passed in this case.
Could you provide an example of what you are trying to achieve?

Regarding the documentation, could you open a PR updating the docs? Our focus this period is the 4.x rewriting.

@overdoignism
Copy link
Author

overdoignism commented Jun 18, 2022

Hi @overdoignism, thanks for reaching out.

EIP 1559 is supported by web3js, however, gasPrice shouldn't be passed in this case. Could you provide an example of what you are trying to achieve?

I'm trying to use the web3js to make an offline sign, for studying and a little offline wallet project.

Sorry for that-- I really don't know the relationship between max/priority fee and gas price.
There are too many theories on the Internet, and English is not my native language. :~
(Some said that if a wallet using gas price which is an old type and it will cost higher gas fee)

Regarding the documentation, could you open a PR updating the docs? Our focus this period is the 4.x rewriting.

Sorry - I have no idea how to fix the document. (What is correct?) :~

@luu-alex
Copy link
Contributor

Hi @overdoignism can you provide what options you are passing into signTransaction? this is the logic behind signTransaction https://github.com/ChainSafe/web3.js/blob/1.x/packages/web3-eth-accounts/src/index.js#L355
We will try to update the docs when we can 👍 thank you for reaching out

@luu-alex luu-alex added the 1.x 1.0 related issues label Jun 21, 2022
@overdoignism
Copy link
Author

Hi @overdoignism can you provide what options you are passing into signTransaction? this is the logic behind signTransaction https://github.com/ChainSafe/web3.js/blob/1.x/packages/web3-eth-accounts/src/index.js#L355 We will try to update the docs when we can 👍 thank you for reaching out

It's my code:

var transaction = {
	to: Reciver_Addr,
	value: TrueSendETH.toString(),
	gas: 21000,
	gasPrice: TrueSendGas.toString(),
	nonce: Sender_nonce,
	chainId: ChainID,
	maxFeePerGas: 50, // a casual value
	maxPriorityFeePerGas: 50,
};

var TR_SIGN_OBJ;
var TR_SIGN;

try {
	TR_SIGN_OBJ = await web3.eth.accounts.signTransaction(transaction, Private_Key);
	TR_SIGN = JSON.stringify(TR_SIGN_OBJ);
} catch (exception) {
	res.write(exception.message);
}

Everything work fine but If maxFeePerGas and maxPriorityFeePerGas present,
it will throw exception.message "eip-1559 transactions don't support gasPrice"

@nazarhussain
Copy link
Contributor

@overdoignism Yes documentation needs to be updated. Would like to contribute and open PR for that change?

@overdoignism
Copy link
Author

@overdoignism Yes documentation needs to be updated. Would like to contribute and open PR for that change?

I hope but have no idea how to... :~

I still studying about Ethereum, web3js, even the JavaScript and GitHub, on the basic stage.
Sorry for that...

@nikoulai
Copy link
Contributor

This PR addresses documentation

@nazarhussain nazarhussain linked a pull request Jun 23, 2022 that will close this issue
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.0 related issues Documentation Relates to project wiki or documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants