中文
PlatON节点伙伴们,PlatON网络赫歇尔 (v1.2.1)版本已经发布,本版本为小版本更新,节点可根据自身情况选择升级。需要升级的情况说明请您查看本文的DApp部分。
升级操作手册:【手册】PlatON网络1.2.1版本升级操作手册
为什么升级
V1.2.0版本虽然已经可以同时支持两个链ID(100和210425),但仍存在以下问题:
1.无法在MetaMask上使用新链ID
2.通过SDK使用新链ID或通过在节点上unlock账户的方式不能创建新的合约
根据PIP-7提案的最终目标,PlatON主网的链ID将最终只支持210425,为了新应用在后续升级过程中影响降低到最小,在PIP-7提案的阶段2中将节点的默认链ID调整为新值210425,这同时也能让MetaMask适配新链ID。这一阶段将通过PlatON V1.2.1版本实现,同时上述不能使用新链ID或通过在节点上unlock账户的方式发起合约部署交易的问题也在该版本一并做了修复。
升级有什么影响
验证人节点
V1.2.1版本是小版本(Patch),无需通过链上提案升级,因此该版本对于验证人节点或候选节点来说无任何影响。
DApp应用
V1.2.1版本升级后,开发者需要注意以下内容的变更,以确定应用逻辑是否需要修改。
1.合约中CHAINID指令返回的仍是旧链ID,后续版本会修改为返回新链ID
2.应用发起交易时既可以使用新链ID也可以继续沿用旧链ID
3.通过RPC接口获取的链ID将是新的链ID
4.用unlock方式发交易用的是新的链ID
已部署大部分的DAPP应用无需修改,但是仍然建议:
1.检查合约中是否使用CHAINID指令,评估该指令返回旧链ID对现有逻辑的影响,需要考虑外部交易可能会使用新链ID,比如通过Metamask签发的交易
2.检查链下发起交易的方式,特别注意使用通过RPC接口获取的链ID是新链ID,unlock方式也是使用新链ID
3.如果要升级合约,且合约中有使用CHAINID指令的,建议同时适配新旧2个链ID
对于新部署的DAPP应用,建议:
1.因PlatON将逐渐减少对旧ID的支持,如无特殊情况请使用新链ID发起交易,这样可以减少后续升级对应用造成的影响
2.由于合约中CHAINID指令返回的仍是旧链ID,且后续会升级为返回新链ID,建议同时适配新旧2个链ID
关于应用适配双ChainId的最佳实践请参考开发手册。
用户
升级到V1.2.1版本后,用户可自行决定使用新链ID还是旧ID。
PlatON主网
1.使用新链ID
如果用户希望使用新链ID,可以在V1.2.1版本发布后通过在MetaMask上添加新网络时指定新RPCURL:https://openapi2.platon.network/rpc。
也可以通过ChainList添加PlatON主网络,打开ChainList(https://chainlist.org/)并搜索"PlatON",可以发现PlatON Mainnet。
2.继续使用旧ID
以旧链ID面向开发者提供的公共RPC服务(地址为https://openapi.platon.network/rpc)将继续保留,升级前已经添加旧链ID网络配置的用户,可以继续使用原有网络配置,但是建议切换为新链ID的网络配置。
PlatON开发网
1.使用新链ID
如果用户想使用新链ID,请在MetaMask上添加新网络时指定新RPCURL:https://devnetopenapi2.platon.network/rpc。
2.继续使用旧ID
和主网类似,PlatON开发网公共RPC地址https://devnetopenapi.platon.network/rpc将继续以旧链ID 210309向开发者提供公共RPC服务,之前已经添加了开发网的MetaMask用户可以继续使用不受影响。
哪些节点需要升级
V1.2.1不需要治理升级,各个节点是否升级都不会影响网络正常运行。
1.验证人节点可以自行决定是否升级
验证节点不升级该版本,使用V1.2.0仍能正常验证或提议区块,可自行选择是否升级。
2.开发者维护的节点
如果开发者的应用使用旧的链ID,可以不用升级节点,但如果开发者希望后续使用新链ID,建议将应用连接的节点升级为V1.2.1。
如何升级
-
升级时间
V1.2.1版本需要在V1.2.0版本升级提案获得通过后才能升级。 -
升级操作
可以在版本发布后待提案通过即直接将节点进程文件替换为v1.2.1。
具体参考《升级操作手册》。
版本说明
赫歇尔 (v1.2.1)是PIP-7提案的第二阶段实现,它将节点使用的默认链ID设置为一个新值(210425)。
新功能
- 将主网的默认链 ID 从 100 更改为 210425。
新补丁
- 修复通过解锁 (truffle-issue-33) 启动交易签名时的合约部署错误。
- 修复使用新链id部署合约时的错误 (issue-1922)。
说明
本版本为小版本更新,节点可根据自身情况选择升级。
English
PlatON nodes,
Herschel (v1.2.1) has been released on PlatON, which is a minor version upgrade. You can decide whether to upgrade as needed. For conditions where an upgrade is advised, please refer to the Impact on DApps section of this article.
Upgrade Operation Manual: 【手册】PlatON网络1.2.1版本升级操作手册
Reasons for the Upgrade
Although V1.2.0 supports two ChainIDs (100 and 210425) at the same time, the following problems still exist:
-
Failure to use the new ChainID on MetaMask
-
A new contract cannot be created by using the new ChainID through the SDK or by unlocking the account on the node
According to the final goal of the PIP-7 proposal, the ChainID of the PlatON Mainnet will eventually be 210425 alone. To minimize the impact on the application in the subsequent upgrade, the default ChainID used by nodes is set to a new value (210425), which also allows MetaMask to adapt to the new ChainID. This stage will be implemented through PlatON V1.2.1. At the same time, the above-mentioned problems, i.e. failure to use the new ChainID or error when a contract deployment is initiated by unlocking the account on the node, are also fixed in this version.
Impact of the Upgrade
Impact on Validators
V1.2.1 is a minor version upgrade (Patch) and does not require on-chain proposals, so there will be no impact on validators or validator candidates.
Impact on DApps
After the upgrade to V1.2.1, developers need to pay attention to the following changes to determine whether the application logic needs to be modified.
- The CHAINID command in the contract still returns the original ChainID, and will return the new ChainID in the subsequent versions
- The application can use both the new ChainID and the original ChainID when initiating transactions
- The new ChainID is obtained through the RPC interface
- The new ChainID is used to send transactions via unlock
Most of the deployed DApps do not need to be modified, but suggestions are as below:
- Check whether the CHAINID command is used in the contract, and evaluate the impact on the existing logic if the command returns the original ChainID. You need to know that external transactions may use the new ChainID , say, transactions issued via Metamask
- Check the way of initiating transactions off-chain. Please be noted that the ChainID obtained through the RPC interface is the new ChainID, and the unlock method also uses the new ChainID
- If you want to upgrade the contract and the contract uses the CHAINID command, it is advised to adapt both the original and the new ChainIDs at the same time
For newly deployed DApps, suggestions are as below:
- Since PlatON will gradually reduce the support for the original ChainID, please use the new ChainID to initiate transactions if possible to alleviate the impact of subsequent upgrades on the application
- Since the CHAINID command in the contract still returns the original ChainID, and will return the new ChainID in the future upgrade, it is advised to adapt both the new and the original ChainIDs
Please refer to the Development Manual for the best practice of DApps’ adaptation to two ChainIDs.
Impact on Users
After upgrading to V1.2.1, users can decide whether to use the new ChainID or the original one.
PlatON Mainnet
- Use the new ChainID
If users wish to use the new ChainID, they can specify a new RPCURL when adding a new network on MetaMask: https://openapi2.platon.network/rpc after the release of V1.2.1.
They may also add PlatON Mainnet through ChainList: open ChainList (https://chainlist.org/), search for “PlatON”, and find the PlatON Mainnet.
- Continue to use the original ChainID
The public RPC service (address: https://openapi.platon.network/rpc) provided for developers with the original ChainID will be retained. Users who have added the original ChainID network configuration before the upgrade can continue to use the original configuration, but it is advised to switch to the network configuration of the new ChainID.
PlatON DevNet
- Use the new ChainID
If users want to use the new ChainID, please specify a new RPCURL when adding a new network on MetaMask: https://devnetopenapi2.platon.network/rpc.
- Continue to use the original ChainID
Similar to the case on the Mainnet, the public RPC address of PlatON DevNet https://devnetopenapi.platon.network/rpc will continue to provide developers with public RPC services with the original ChainID 210309. MetaMask users who have added the DevNet can still use it without any impact.
Nodes That Need An Upgrade
V1.2.1 does not require governance upgrades, and whether each node is upgraded will not affect the normal operation of the network.
-
The validator can decide whether to upgrade or not
If the validator does not upgrade to this version, V1.2.0 can still verify or propose blocks normally. Validators can determine whether to upgrade or not by themselves. -
Nodes maintained by developers
If the developer’s application uses the original ChainID, an upgrade is not a must. But if the developer wants to use the new ChainID in the future, it is advised to upgrade the node connected by the application to V1.2.1.
How to Upgrade
- Upgrade time
An upgrade to V1.2.1 can be possible only after the V1.2.0 upgrade proposal is approved. - Upgrade operation
You can directly replace the node process file with v1.2.1 after the version is released and the proposal is passed.
For details, refer to the Upgrade Operation Manual.
Version Statement
Herschel (v1.2.1) is the second phase implementation of the PIP-7 proposal, which sets the default ChainID used by nodes to a new value (210425).
New Features
- Change the Mainnet’s default ChainID from 100 to 210425.
New Fixes
- Fix contract deployment error when initiating transaction signatures via unlock (truffle-issue-33).
- Fix error when deploying a contract with a new ChainID (issue-1922).
Statement
This version is a minor version upgrade. Each node can determine whether to upgrade or not as needed.