web3.js 1.2.7-rc.0
Pre-releaseHi!
Features
Alongside some small bug fixes, this release contains two large improvements, authored by @nivida.
-
The Websocket Provider module has been rewritten and now supports an auto-reconnect option which should dramatically improve the stability of connections to remote clients like Infura. In addition, the way Web3 manages requests under the hood has been simplified with the dividend that the
MaxListenersExceededWarning
should pop up far less often. (PR #3190) -
The ENS module now allows connection to a custom registry and support for a large number of additional Registry and Resolver methods has been added. (PR #3325)
Check out the documentation for more details about both of these.
Note about behavioral change in Geth 1.9.12
Recently in issue #3456 @Aniket-Engg drew attention to an important breaking change in Geth 1.9.12 which affects Web3 users. From their release notes:
eth_call will not default to your first account any more if you don't explicitly specify a sender. This was done
to avoid the same input behaving differently in different environments.
This means that if you're calling view
methods that refer to a msg.sender
without explicitly setting a from
address in your request options, you may see unexpected behavior.
In Web3.js, the from
address can be specified on a per-call basis or by setting the defaultAccount property
// Call
myContract.methods.myMethod(123).call({from: '0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe'});
// Contract
web3.eth.Contract.defaultAccount = '0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe';
// Instance
contractInstance.defaultAccount = '0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe';
// All
web3.eth.defaultAccount = '0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe';
Added
- Add revert reason support to sendSignedTransaction (#3345)
- ENS module extended with the possibility to add a custom registry (#3301)
- Missing ENS Registry methods and Resolver.supportsInterface method added (#3325)
- Add optional gas type to AbiItem typescript definitions (for ABIs generated by Vyper) (#3437)
- Add görli testnet ENS registry to the known registries (#3252)
- Add auto-reconnect option for Websockets (#3092, #1085, #1391, #1558, #1852, #1646)
Changed
- Ensure '0x' prefix is existing for Accounts.sign and Accounts.privateKeyToAccount (#3041)
- Repository cleanup (#3443)
- Removed old
docs/_build
folder - Removed old bower and meteor artifacts
- Moved logo assets to own folder
- Moved github assets to own folder
- Removed old
- Remove @types/node from (non-dev) dependency tree (#3965, #3227)
Fixed
- Add missing subscription.on('connected') TS type definition (#3319)
- Add missing bignumber.js dependency for TS types (#3386)
- Upgrade swarm-js to 0.1.40 to remove npm vulnerability warning (#3399)
- Upgrade devDeps to resolve security warnings (#3464)
- dtslint 0.4.2 => 3.4.1
- definitelytyped-header-parser 1.0.1 => 3.9.0
- Race-condition when subscribing to historical logs as first client request (#3389)
- Fix crash when using Web-Workers by removing any-promise dependency (#3377 #2211 #1774)
- MaxListenersExceededWarning event emitter warning mitigated (#1648)
Please don't hesitate to report any problems you see to the issues, and thanks for checking out this new release!