The most anticipated Ethereum London fork upgrade is here! It includes the improvement proposal EIP-1559. The upgrade is scheduled to go live on mainnet at block number 12,965,000, and expected to complete August 5.
The legacy transaction model on Ethereum uses an auction style where highest bidders are going first on blocks which have a limited size. This auction style has caused trouble for many users as they will often wait for gas prices to go down, which can take hours or even days!
Another downside of this model is the vulnerability of high prices of gas being created by artificial demand from malicious miners. We’ve also seen the network become congested, the success of DeFi during the Summer of 2020 saw Ethereum gas prices soar with total fees sometimes reaching as high as $500 for a single transaction.
EIP-1559 aims to improve upon this old model by aiming to make transaction fee more predictable, and calculate the fee algorithmically instead of the miner’s based auction system. To achieve this, the protocol introduces two key changes:
- A Market Rate for transactions called BASEFEE: A known price for gas which helps users to estimate gas prices and avoid overpaying. Additional tips can be provided to miners to give priority for your transactions.
- Dynamic block sizes: Now a block size has the same limit as before (15M gas in size) but with a flexibility to increase to 30M gas in size.
Web3j 4.8.7 release includes the changes to support new transaction types with additional fields required for the JSON RPC API.
The following section is a walkthrough of how to send EIP-1559 with Web3j.
EIP-1559 with Web3j
Getting started with adding library to project using Maven:-
Or using Gradle:-
Configure http service and credentials:-
Web3j web3 = Web3j.build(new HttpService());
Credentials credentials =
Use the Transfer class for sending Ether with EIP-1559 new fields:-
TransactionReceipt transactionReceipt = Transfer.sendFundsEIP1559(
Access new attributes effectiveGasPrice and type through TransactionReceipt:-
Use Web3j to get block and access new fields:-
EthBlock.Block block = web3j.ethGetBlockByNumber(
Other options to get block or get uncle like:-
EthBlock.Block block = web3j.ethGetBlockByHash(String blockHash, boolean returnFullTransactionObjects);
EthBlock.Block block = web3j.ethGetUncleByBlockHashAndIndex(String blockHash, BigInteger transactionIndex);
EthBlock.Block block = web3j.ethGetUncleByBlockNumberAndIndex(
DefaultBlockParameter defaultBlockParameter, BigInteger transactionIndex);
Access Transactions new field through Web3j:-
EthTransaction ethTransaction = web3j.ethGetTransactionByHash(String transactionHash).send();
EthTransaction ethTransaction = web3j.ethGetTransactionByBlockHashAndIndex(String blockHash, BigInteger transactionIndex).send();
EthTransaction ethTransaction = web3j.ethGetTransactionByBlockNumberAndIndex(DefaultBlockParameter defaultBlockParameter, BigInteger transactionIndex).send();
Access new transaction:-
Please refer to web3j documentation for more details.
EIP-1559 is considered to be one of the most important Ethereum Improvement Proposals. It’s expected to have a big impact on the user experience as well as the economics of the network. The gas fee is likely to be reduced by 90% and the burning mechanism is said to make Ethereum deflationary.
As Etheruem moves from Proof-of-Work to Proof-of-Stake, this upgrade is also important for the security of the network and energy consumption. To find out more, read our blog here which explains the consensus algorithm called Proof of Work and its competitor, Proof of Stake.
Thanks to all who contributed to Web3j and helped the development of EIP-1559. We encourage all users and developers to contribute to our Web3j github repo.
What are your thoughts on EIP-1559? Let us know in the comments! In the meantime, to stay abreast of all blockchain trends, listen or watch This Week in Blockchain through (watch.)weekinblockchain.com, or through your preferred podcast platform.