Compare commits
11 Commits
zzzckck-pa
...
pascal-har
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
19e8487315 | ||
|
|
55896bf610 | ||
|
|
bff9d252d6 | ||
|
|
27f67a5210 | ||
|
|
8c1acb0b22 | ||
|
|
089064c1ff | ||
|
|
5289ecdfe2 | ||
|
|
d141ff06c3 | ||
|
|
9cbac84363 | ||
|
|
21faa2de3f | ||
|
|
34059cb144 |
8
.github/workflows/pre-release.yml
vendored
8
.github/workflows/pre-release.yml
vendored
@@ -82,28 +82,28 @@ jobs:
|
|||||||
# ==============================
|
# ==============================
|
||||||
|
|
||||||
- name: Upload Linux Build
|
- name: Upload Linux Build
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4.3.3
|
||||||
if: matrix.os == 'ubuntu-latest'
|
if: matrix.os == 'ubuntu-latest'
|
||||||
with:
|
with:
|
||||||
name: linux
|
name: linux
|
||||||
path: ./build/bin/geth
|
path: ./build/bin/geth
|
||||||
|
|
||||||
- name: Upload MacOS Build
|
- name: Upload MacOS Build
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4.3.3
|
||||||
if: matrix.os == 'macos-latest'
|
if: matrix.os == 'macos-latest'
|
||||||
with:
|
with:
|
||||||
name: macos
|
name: macos
|
||||||
path: ./build/bin/geth
|
path: ./build/bin/geth
|
||||||
|
|
||||||
- name: Upload Windows Build
|
- name: Upload Windows Build
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4.3.3
|
||||||
if: matrix.os == 'windows-latest'
|
if: matrix.os == 'windows-latest'
|
||||||
with:
|
with:
|
||||||
name: windows
|
name: windows
|
||||||
path: ./build/bin/geth.exe
|
path: ./build/bin/geth.exe
|
||||||
|
|
||||||
- name: Upload ARM-64 Build
|
- name: Upload ARM-64 Build
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4.3.3
|
||||||
if: matrix.os == 'ubuntu-latest'
|
if: matrix.os == 'ubuntu-latest'
|
||||||
with:
|
with:
|
||||||
name: arm64
|
name: arm64
|
||||||
|
|||||||
8
.github/workflows/release.yml
vendored
8
.github/workflows/release.yml
vendored
@@ -81,28 +81,28 @@ jobs:
|
|||||||
# ==============================
|
# ==============================
|
||||||
|
|
||||||
- name: Upload Linux Build
|
- name: Upload Linux Build
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4.3.3
|
||||||
if: matrix.os == 'ubuntu-latest'
|
if: matrix.os == 'ubuntu-latest'
|
||||||
with:
|
with:
|
||||||
name: linux
|
name: linux
|
||||||
path: ./build/bin/geth
|
path: ./build/bin/geth
|
||||||
|
|
||||||
- name: Upload MacOS Build
|
- name: Upload MacOS Build
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4.3.3
|
||||||
if: matrix.os == 'macos-latest'
|
if: matrix.os == 'macos-latest'
|
||||||
with:
|
with:
|
||||||
name: macos
|
name: macos
|
||||||
path: ./build/bin/geth
|
path: ./build/bin/geth
|
||||||
|
|
||||||
- name: Upload Windows Build
|
- name: Upload Windows Build
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4.3.3
|
||||||
if: matrix.os == 'windows-latest'
|
if: matrix.os == 'windows-latest'
|
||||||
with:
|
with:
|
||||||
name: windows
|
name: windows
|
||||||
path: ./build/bin/geth.exe
|
path: ./build/bin/geth.exe
|
||||||
|
|
||||||
- name: Upload ARM-64 Build
|
- name: Upload ARM-64 Build
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4.3.3
|
||||||
if: matrix.os == 'ubuntu-latest'
|
if: matrix.os == 'ubuntu-latest'
|
||||||
with:
|
with:
|
||||||
name: arm64
|
name: arm64
|
||||||
|
|||||||
22
CHANGELOG.md
22
CHANGELOG.md
@@ -1,4 +1,26 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
## v1.4.15
|
||||||
|
### BUGFIX
|
||||||
|
* [\#2680](https://github.com/bnb-chain/bsc/pull/2680) txpool: apply miner's gasceil to txpool
|
||||||
|
* [\#2688](https://github.com/bnb-chain/bsc/pull/2688) txpool: set default GasCeil from 30M to 0
|
||||||
|
* [\#2696](https://github.com/bnb-chain/bsc/pull/2696) miner: limit block size to eth protocol msg size
|
||||||
|
* [\#2684](https://github.com/bnb-chain/bsc/pull/2684) eth: Add sidecars when available to broadcasted current block
|
||||||
|
|
||||||
|
### FEATURE
|
||||||
|
* [\#2672](https://github.com/bnb-chain/bsc/pull/2672) faucet: with mainnet balance check, 0.002BNB at least
|
||||||
|
* [\#2678](https://github.com/bnb-chain/bsc/pull/2678) beaconserver: simulated beacon api server for op-stack
|
||||||
|
* [\#2687](https://github.com/bnb-chain/bsc/pull/2687) faucet: support customized token
|
||||||
|
* [\#2698](https://github.com/bnb-chain/bsc/pull/2698) faucet: add example for custimized token
|
||||||
|
* [\#2706](https://github.com/bnb-chain/bsc/pull/2706) faucet: update DIN token faucet support
|
||||||
|
|
||||||
|
### IMPROVEMENT
|
||||||
|
* [\#2677](https://github.com/bnb-chain/bsc/pull/2677) log: add some p2p log
|
||||||
|
* [\#2679](https://github.com/bnb-chain/bsc/pull/2679) build(deps): bump actions/download-artifact in /.github/workflows
|
||||||
|
* [\#2662](https://github.com/bnb-chain/bsc/pull/2662) metrics: add some extra feature flags as node stats
|
||||||
|
* [\#2675](https://github.com/bnb-chain/bsc/pull/2675) fetcher: Sleep after marking block as done when requeuing
|
||||||
|
* [\#2695](https://github.com/bnb-chain/bsc/pull/2695) CI: nancy ignore CVE-2024-8421
|
||||||
|
* [\#2689](https://github.com/bnb-chain/bsc/pull/2689) consensus/parlia: wait more time when processing huge blocks
|
||||||
|
|
||||||
## v1.4.14
|
## v1.4.14
|
||||||
|
|
||||||
### BUGFIX
|
### BUGFIX
|
||||||
|
|||||||
26
README.md
26
README.md
@@ -9,16 +9,15 @@ https://pkg.go.dev/badge/github.com/ethereum/go-ethereum
|
|||||||
)](https://pkg.go.dev/github.com/ethereum/go-ethereum?tab=doc)
|
)](https://pkg.go.dev/github.com/ethereum/go-ethereum?tab=doc)
|
||||||
[](https://discord.gg/z2VpC455eU)
|
[](https://discord.gg/z2VpC455eU)
|
||||||
|
|
||||||
But from that baseline of EVM compatible, BNB Smart Chain introduces a system of 21 validators with Proof of Staked Authority (PoSA) consensus that can support short block time and lower fees. The most bonded validator candidates of staking will become validators and produce blocks. The double-sign detection and other slashing logic guarantee security, stability, and chain finality.
|
But from that baseline of EVM compatible, BNB Smart Chain introduces a system of 21 validators with Proof of Staked Authority (PoSA) consensus that can support short block time and lower fees. The most bonded validator candidates of staking will become validators and produce blocks. The double-sign detection and other slashing logic guarantee security, stability, and chain finality.
|
||||||
|
|
||||||
Cross-chain transfer and other communication are possible due to native support of interoperability. Relayers and on-chain contracts are developed to support that. BNB Beacon Chain DEX remains a liquid venue of the exchange of assets on both chains. This dual-chain architecture will be ideal for users to take advantage of the fast trading on one side and build their decentralized apps on the other side. **The BNB Smart Chain** will be:
|
**The BNB Smart Chain** will be:
|
||||||
|
|
||||||
- **A self-sovereign blockchain**: Provides security and safety with elected validators.
|
- **A self-sovereign blockchain**: Provides security and safety with elected validators.
|
||||||
- **EVM-compatible**: Supports all the existing Ethereum tooling along with faster finality and cheaper transaction fees.
|
- **EVM-compatible**: Supports all the existing Ethereum tooling along with faster finality and cheaper transaction fees.
|
||||||
- **Interoperable**: Comes with efficient native dual chain communication; Optimized for scaling high-performance dApps that require fast and smooth user experience.
|
|
||||||
- **Distributed with on-chain governance**: Proof of Staked Authority brings in decentralization and community participants. As the native token, BNB will serve as both the gas of smart contract execution and tokens for staking.
|
- **Distributed with on-chain governance**: Proof of Staked Authority brings in decentralization and community participants. As the native token, BNB will serve as both the gas of smart contract execution and tokens for staking.
|
||||||
|
|
||||||
More details in [White Paper](https://www.bnbchain.org/en#smartChain).
|
More details in [White Paper](https://github.com/bnb-chain/whitepaper/blob/master/WHITEPAPER.md).
|
||||||
|
|
||||||
## Key features
|
## Key features
|
||||||
|
|
||||||
@@ -34,18 +33,8 @@ To combine DPoS and PoA for consensus, BNB Smart Chain implement a novel consens
|
|||||||
|
|
||||||
1. Blocks are produced by a limited set of validators.
|
1. Blocks are produced by a limited set of validators.
|
||||||
2. Validators take turns to produce blocks in a PoA manner, similar to Ethereum's Clique consensus engine.
|
2. Validators take turns to produce blocks in a PoA manner, similar to Ethereum's Clique consensus engine.
|
||||||
3. Validator set are elected in and out based on a staking based governance on BNB Beacon Chain.
|
3. Validator set are elected in and out based on a staking based governance on BNB Smart Chain.
|
||||||
4. The validator set change is relayed via a cross-chain communication mechanism.
|
4. Parlia consensus engine will interact with a set of [system contracts](https://docs.bnbchain.org/bnb-smart-chain/staking/overview/#system-contracts) to achieve liveness slash, revenue distributing and validator set renewing func.
|
||||||
5. Parlia consensus engine will interact with a set of [system contracts](https://docs.bnbchain.org/bnb-smart-chain/staking/overview/#system-contracts) to achieve liveness slash, revenue distributing and validator set renewing func.
|
|
||||||
|
|
||||||
|
|
||||||
### Light Client of BNB Beacon Chain
|
|
||||||
|
|
||||||
To achieve the cross-chain communication from BNB Beacon Chain to BNB Smart Chain, need introduce a on-chain light client verification algorithm.
|
|
||||||
It contains two parts:
|
|
||||||
|
|
||||||
1. [Stateless Precompiled contracts](https://github.com/bnb-chain/bsc/blob/master/core/vm/contracts_lightclient.go) to do tendermint header verification and Merkle Proof verification.
|
|
||||||
2. [Stateful solidity contracts](https://github.com/bnb-chain/bsc-genesis-contract/blob/master/contracts/TendermintLightClient.sol) to store validator set and trusted appHash.
|
|
||||||
|
|
||||||
## Native Token
|
## Native Token
|
||||||
|
|
||||||
@@ -53,7 +42,6 @@ BNB will run on BNB Smart Chain in the same way as ETH runs on Ethereum so that
|
|||||||
BNB will be used to:
|
BNB will be used to:
|
||||||
|
|
||||||
1. pay `gas` to deploy or invoke Smart Contract on BSC
|
1. pay `gas` to deploy or invoke Smart Contract on BSC
|
||||||
2. perform cross-chain operations, such as transfer token assets across BNB Smart Chain and BNB Beacon Chain.
|
|
||||||
|
|
||||||
## Building the source
|
## Building the source
|
||||||
|
|
||||||
@@ -247,9 +235,7 @@ running web servers, so malicious web pages could try to subvert locally availab
|
|||||||
APIs!**
|
APIs!**
|
||||||
|
|
||||||
### Operating a private network
|
### Operating a private network
|
||||||
- [BSC-Deploy](https://github.com/bnb-chain/node-deploy/): deploy tool for setting up both BNB Beacon Chain, BNB Smart Chain and the cross chain infrastructure between them.
|
- [BSC-Deploy](https://github.com/bnb-chain/node-deploy/): deploy tool for setting up BNB Smart Chain.
|
||||||
- [BSC-Docker](https://github.com/bnb-chain/bsc-docker): deploy tool for setting up local BSC cluster in container.
|
|
||||||
|
|
||||||
|
|
||||||
## Running a bootnode
|
## Running a bootnode
|
||||||
|
|
||||||
|
|||||||
BIN
cmd/faucet/customized/DIN.png
Normal file
BIN
cmd/faucet/customized/DIN.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
@@ -2,9 +2,10 @@
|
|||||||
This is to support some projects with customized tokens that they want to integrate into the BSC faucet tool.
|
This is to support some projects with customized tokens that they want to integrate into the BSC faucet tool.
|
||||||
|
|
||||||
## 1.1. How to Integrate Your Token
|
## 1.1. How to Integrate Your Token
|
||||||
- Step 1: Submmit a Pull Request to [bsc develop branch](https://github.com/bnb-chain/bsc/tree/develop) with relevant token information: `symbol`, `amount`, `icon`, `addr`. Append these information in [Section 2: Token List](#2token-list)
|
- Step 1: Fund the faucet address by sending a specific amount of your BEP-20 token to the faucet address (0xaa25aa7a19f9c426e07dee59b12f944f4d9f1dd3) on the BSC testnet.
|
||||||
- Step 2: Wait for approval, we will review the request, and once it is approved, the faucet tool will start to support the customized token and list it on https://www.bnbchain.org/en/testnet-faucet.
|
- Step 2: Update this README.md file and create a Pull Request on [bsc github](https://github.com/bnb-chain/bsc) with relevant information.
|
||||||
- Step 3: Deposit your test token to designated address(0xaa25aa7a19f9c426e07dee59b12f944f4d9f1dd3) on the BSC testnet.
|
|
||||||
|
We will review the request, and once it is approved, the faucet tool will start to support the customized token and list it on https://www.bnbchain.org/en/testnet-faucet.
|
||||||
|
|
||||||
# 2.Token List
|
# 2.Token List
|
||||||
## 2.1.DemoToken
|
## 2.1.DemoToken
|
||||||
@@ -12,3 +13,11 @@ This is to support some projects with customized tokens that they want to integr
|
|||||||
- amount: 10000000000000000000
|
- amount: 10000000000000000000
|
||||||
- icon: ./demotoken.png
|
- icon: ./demotoken.png
|
||||||
- addr: https://testnet.bscscan.com/address/0xe15c158d768c306dae87b96430a94f884333e55d
|
- addr: https://testnet.bscscan.com/address/0xe15c158d768c306dae87b96430a94f884333e55d
|
||||||
|
- fundTx: [0xa499dc9aaf918aff0507538a8aa80a88d0af6ca15054e6acc57b69c651945280](https://testnet.bscscan.com/tx/0x2a3f334b6ca756b64331bdec9e6cf3207ac50a4839fda6379e909de4d9a194ca)
|
||||||
|
-
|
||||||
|
## 2.2.DIN token
|
||||||
|
- symbol: DIN
|
||||||
|
- amount: 10000000000000000000
|
||||||
|
- icon: ./DIN.png
|
||||||
|
- addr: https://testnet.bscscan.com/address/0xb8b40FcC5B4519Dba0E07Ac8821884CE90BdE677
|
||||||
|
- fundTx: [0x17fc4c1db133830c7c146a0d41ca1df31cb446989ec11b382d58bb6176d6fde3](https://testnet.bscscan.com/tx/0x17fc4c1db133830c7c146a0d41ca1df31cb446989ec11b382d58bb6176d6fde3)
|
||||||
|
|||||||
@@ -63,7 +63,8 @@ var (
|
|||||||
Flags: flags.Merge([]cli.Flag{
|
Flags: flags.Merge([]cli.Flag{
|
||||||
utils.CachePreimagesFlag,
|
utils.CachePreimagesFlag,
|
||||||
utils.OverridePassedForkTime,
|
utils.OverridePassedForkTime,
|
||||||
utils.OverrideBohr,
|
utils.OverridePascal,
|
||||||
|
utils.OverridePrague,
|
||||||
utils.OverrideVerkle,
|
utils.OverrideVerkle,
|
||||||
utils.MultiDataBaseFlag,
|
utils.MultiDataBaseFlag,
|
||||||
}, utils.DatabaseFlags),
|
}, utils.DatabaseFlags),
|
||||||
@@ -258,9 +259,13 @@ func initGenesis(ctx *cli.Context) error {
|
|||||||
v := ctx.Uint64(utils.OverridePassedForkTime.Name)
|
v := ctx.Uint64(utils.OverridePassedForkTime.Name)
|
||||||
overrides.OverridePassedForkTime = &v
|
overrides.OverridePassedForkTime = &v
|
||||||
}
|
}
|
||||||
if ctx.IsSet(utils.OverrideBohr.Name) {
|
if ctx.IsSet(utils.OverridePascal.Name) {
|
||||||
v := ctx.Uint64(utils.OverrideBohr.Name)
|
v := ctx.Uint64(utils.OverridePascal.Name)
|
||||||
overrides.OverrideBohr = &v
|
overrides.OverridePascal = &v
|
||||||
|
}
|
||||||
|
if ctx.IsSet(utils.OverridePrague.Name) {
|
||||||
|
v := ctx.Uint64(utils.OverridePrague.Name)
|
||||||
|
overrides.OverridePrague = &v
|
||||||
}
|
}
|
||||||
if ctx.IsSet(utils.OverrideVerkle.Name) {
|
if ctx.IsSet(utils.OverrideVerkle.Name) {
|
||||||
v := ctx.Uint64(utils.OverrideVerkle.Name)
|
v := ctx.Uint64(utils.OverrideVerkle.Name)
|
||||||
|
|||||||
@@ -191,9 +191,13 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
|
|||||||
v := ctx.Uint64(utils.OverridePassedForkTime.Name)
|
v := ctx.Uint64(utils.OverridePassedForkTime.Name)
|
||||||
cfg.Eth.OverridePassedForkTime = &v
|
cfg.Eth.OverridePassedForkTime = &v
|
||||||
}
|
}
|
||||||
if ctx.IsSet(utils.OverrideBohr.Name) {
|
if ctx.IsSet(utils.OverridePascal.Name) {
|
||||||
v := ctx.Uint64(utils.OverrideBohr.Name)
|
v := ctx.Uint64(utils.OverridePascal.Name)
|
||||||
cfg.Eth.OverrideBohr = &v
|
cfg.Eth.OverridePascal = &v
|
||||||
|
}
|
||||||
|
if ctx.IsSet(utils.OverridePrague.Name) {
|
||||||
|
v := ctx.Uint64(utils.OverridePrague.Name)
|
||||||
|
cfg.Eth.OverridePrague = &v
|
||||||
}
|
}
|
||||||
if ctx.IsSet(utils.OverrideVerkle.Name) {
|
if ctx.IsSet(utils.OverrideVerkle.Name) {
|
||||||
v := ctx.Uint64(utils.OverrideVerkle.Name)
|
v := ctx.Uint64(utils.OverrideVerkle.Name)
|
||||||
|
|||||||
@@ -73,7 +73,8 @@ var (
|
|||||||
utils.SmartCardDaemonPathFlag,
|
utils.SmartCardDaemonPathFlag,
|
||||||
utils.RialtoHash,
|
utils.RialtoHash,
|
||||||
utils.OverridePassedForkTime,
|
utils.OverridePassedForkTime,
|
||||||
utils.OverrideBohr,
|
utils.OverridePascal,
|
||||||
|
utils.OverridePrague,
|
||||||
utils.OverrideVerkle,
|
utils.OverrideVerkle,
|
||||||
utils.OverrideFullImmutabilityThreshold,
|
utils.OverrideFullImmutabilityThreshold,
|
||||||
utils.OverrideMinBlocksForBlobRequests,
|
utils.OverrideMinBlocksForBlobRequests,
|
||||||
|
|||||||
@@ -310,12 +310,17 @@ var (
|
|||||||
}
|
}
|
||||||
OverridePassedForkTime = &cli.Uint64Flag{
|
OverridePassedForkTime = &cli.Uint64Flag{
|
||||||
Name: "override.passedforktime",
|
Name: "override.passedforktime",
|
||||||
Usage: "Manually specify the hard fork timestamp except the last one, overriding the bundled setting",
|
Usage: "Manually specify the hard fork timestamps which have passed on the mainnet, overriding the bundled setting",
|
||||||
Category: flags.EthCategory,
|
Category: flags.EthCategory,
|
||||||
}
|
}
|
||||||
OverrideBohr = &cli.Uint64Flag{
|
OverridePascal = &cli.Uint64Flag{
|
||||||
Name: "override.bohr",
|
Name: "override.pascal",
|
||||||
Usage: "Manually specify the Bohr fork timestamp, overriding the bundled setting",
|
Usage: "Manually specify the Pascal fork timestamp, overriding the bundled setting",
|
||||||
|
Category: flags.EthCategory,
|
||||||
|
}
|
||||||
|
OverridePrague = &cli.Uint64Flag{
|
||||||
|
Name: "override.prague",
|
||||||
|
Usage: "Manually specify the Prague fork timestamp, overriding the bundled setting",
|
||||||
Category: flags.EthCategory,
|
Category: flags.EthCategory,
|
||||||
}
|
}
|
||||||
OverrideVerkle = &cli.Uint64Flag{
|
OverrideVerkle = &cli.Uint64Flag{
|
||||||
|
|||||||
@@ -66,31 +66,6 @@ func NewBlockValidator(config *params.ChainConfig, blockchain *BlockChain, engin
|
|||||||
return validator
|
return validator
|
||||||
}
|
}
|
||||||
|
|
||||||
// ValidateListsInBody validates that UncleHash, WithdrawalsHash, and WithdrawalsHash correspond to the lists in the block body, respectively.
|
|
||||||
func ValidateListsInBody(block *types.Block) error {
|
|
||||||
header := block.Header()
|
|
||||||
if hash := types.CalcUncleHash(block.Uncles()); hash != header.UncleHash {
|
|
||||||
return fmt.Errorf("uncle root hash mismatch (header value %x, calculated %x)", header.UncleHash, hash)
|
|
||||||
}
|
|
||||||
if hash := types.DeriveSha(block.Transactions(), trie.NewStackTrie(nil)); hash != header.TxHash {
|
|
||||||
return fmt.Errorf("transaction root hash mismatch: have %x, want %x", hash, header.TxHash)
|
|
||||||
}
|
|
||||||
// Withdrawals are present after the Shanghai fork.
|
|
||||||
if header.WithdrawalsHash != nil {
|
|
||||||
// Withdrawals list must be present in body after Shanghai.
|
|
||||||
if block.Withdrawals() == nil {
|
|
||||||
return errors.New("missing withdrawals in block body")
|
|
||||||
}
|
|
||||||
if hash := types.DeriveSha(block.Withdrawals(), trie.NewStackTrie(nil)); hash != *header.WithdrawalsHash {
|
|
||||||
return fmt.Errorf("withdrawals root hash mismatch (header value %x, calculated %x)", *header.WithdrawalsHash, hash)
|
|
||||||
}
|
|
||||||
} else if block.Withdrawals() != nil { // Withdrawals turn into empty from nil when BlockBody has Sidecars
|
|
||||||
// Withdrawals are not allowed prior to shanghai fork
|
|
||||||
return errors.New("withdrawals present in block body")
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateBody validates the given block's uncles and verifies the block
|
// ValidateBody validates the given block's uncles and verifies the block
|
||||||
// header's transaction and uncle roots. The headers are assumed to be already
|
// header's transaction and uncle roots. The headers are assumed to be already
|
||||||
// validated at this point.
|
// validated at this point.
|
||||||
@@ -108,12 +83,31 @@ func (v *BlockValidator) ValidateBody(block *types.Block) error {
|
|||||||
if err := v.engine.VerifyUncles(v.bc, block); err != nil {
|
if err := v.engine.VerifyUncles(v.bc, block); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if hash := types.CalcUncleHash(block.Uncles()); hash != header.UncleHash {
|
||||||
|
return fmt.Errorf("uncle root hash mismatch (header value %x, calculated %x)", header.UncleHash, hash)
|
||||||
|
}
|
||||||
|
|
||||||
validateFuns := []func() error{
|
validateFuns := []func() error{
|
||||||
func() error {
|
func() error {
|
||||||
return ValidateListsInBody(block)
|
if hash := types.DeriveSha(block.Transactions(), trie.NewStackTrie(nil)); hash != header.TxHash {
|
||||||
|
return fmt.Errorf("transaction root hash mismatch: have %x, want %x", hash, header.TxHash)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
},
|
},
|
||||||
func() error {
|
func() error {
|
||||||
|
// Withdrawals are present after the Shanghai fork.
|
||||||
|
if header.WithdrawalsHash != nil {
|
||||||
|
// Withdrawals list must be present in body after Shanghai.
|
||||||
|
if block.Withdrawals() == nil {
|
||||||
|
return errors.New("missing withdrawals in block body")
|
||||||
|
}
|
||||||
|
if hash := types.DeriveSha(block.Withdrawals(), trie.NewStackTrie(nil)); hash != *header.WithdrawalsHash {
|
||||||
|
return fmt.Errorf("withdrawals root hash mismatch (header value %x, calculated %x)", *header.WithdrawalsHash, hash)
|
||||||
|
}
|
||||||
|
} else if block.Withdrawals() != nil { // Withdrawals turn into empty from nil when BlockBody has Sidecars
|
||||||
|
// Withdrawals are not allowed prior to shanghai fork
|
||||||
|
return errors.New("withdrawals present in block body")
|
||||||
|
}
|
||||||
// Blob transactions may be present after the Cancun fork.
|
// Blob transactions may be present after the Cancun fork.
|
||||||
var blobs int
|
var blobs int
|
||||||
for i, tx := range block.Transactions() {
|
for i, tx := range block.Transactions() {
|
||||||
|
|||||||
@@ -217,7 +217,8 @@ func (e *GenesisMismatchError) Error() string {
|
|||||||
// Typically, these modifications involve hardforks that are not enabled on the BSC mainnet, intended for testing purposes.
|
// Typically, these modifications involve hardforks that are not enabled on the BSC mainnet, intended for testing purposes.
|
||||||
type ChainOverrides struct {
|
type ChainOverrides struct {
|
||||||
OverridePassedForkTime *uint64
|
OverridePassedForkTime *uint64
|
||||||
OverrideBohr *uint64
|
OverridePascal *uint64
|
||||||
|
OverridePrague *uint64
|
||||||
OverrideVerkle *uint64
|
OverrideVerkle *uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,9 +253,13 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *triedb.Database, g
|
|||||||
config.CancunTime = overrides.OverridePassedForkTime
|
config.CancunTime = overrides.OverridePassedForkTime
|
||||||
config.HaberTime = overrides.OverridePassedForkTime
|
config.HaberTime = overrides.OverridePassedForkTime
|
||||||
config.HaberFixTime = overrides.OverridePassedForkTime
|
config.HaberFixTime = overrides.OverridePassedForkTime
|
||||||
|
config.BohrTime = overrides.OverridePassedForkTime
|
||||||
}
|
}
|
||||||
if overrides != nil && overrides.OverrideBohr != nil {
|
if overrides != nil && overrides.OverridePascal != nil {
|
||||||
config.BohrTime = overrides.OverrideBohr
|
config.PascalTime = overrides.OverridePascal
|
||||||
|
}
|
||||||
|
if overrides != nil && overrides.OverridePrague != nil {
|
||||||
|
config.PragueTime = overrides.OverridePrague
|
||||||
}
|
}
|
||||||
if overrides != nil && overrides.OverrideVerkle != nil {
|
if overrides != nil && overrides.OverrideVerkle != nil {
|
||||||
config.VerkleTime = overrides.OverrideVerkle
|
config.VerkleTime = overrides.OverrideVerkle
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -17,11 +17,3 @@ var (
|
|||||||
//go:embed chapel/StakeHubContract
|
//go:embed chapel/StakeHubContract
|
||||||
ChapelStakeHubContract string
|
ChapelStakeHubContract string
|
||||||
)
|
)
|
||||||
|
|
||||||
// contract codes for Rialto upgrade
|
|
||||||
var (
|
|
||||||
//go:embed rialto/ValidatorContract
|
|
||||||
RialtoValidatorContract string
|
|
||||||
//go:embed rialto/StakeHubContract
|
|
||||||
RialtoStakeHubContract string
|
|
||||||
)
|
|
||||||
|
|||||||
1
core/systemcontracts/pascal/chapel/CrossChainContract
Normal file
1
core/systemcontracts/pascal/chapel/CrossChainContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/chapel/GovHubContract
Normal file
1
core/systemcontracts/pascal/chapel/GovHubContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/chapel/GovTokenContract
Normal file
1
core/systemcontracts/pascal/chapel/GovTokenContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/chapel/GovernorContract
Normal file
1
core/systemcontracts/pascal/chapel/GovernorContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/chapel/LightClientContract
Normal file
1
core/systemcontracts/pascal/chapel/LightClientContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/chapel/RelayerHubContract
Normal file
1
core/systemcontracts/pascal/chapel/RelayerHubContract
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/chapel/SlashContract
Normal file
1
core/systemcontracts/pascal/chapel/SlashContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/chapel/StakeCreditContract
Normal file
1
core/systemcontracts/pascal/chapel/StakeCreditContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/chapel/StakeHubContract
Normal file
1
core/systemcontracts/pascal/chapel/StakeHubContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/chapel/StakingContract
Normal file
1
core/systemcontracts/pascal/chapel/StakingContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/chapel/SystemRewardContract
Normal file
1
core/systemcontracts/pascal/chapel/SystemRewardContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/chapel/TimelockContract
Normal file
1
core/systemcontracts/pascal/chapel/TimelockContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/chapel/TokenHubContract
Normal file
1
core/systemcontracts/pascal/chapel/TokenHubContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/chapel/TokenManagerContract
Normal file
1
core/systemcontracts/pascal/chapel/TokenManagerContract
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/chapel/ValidatorContract
Normal file
1
core/systemcontracts/pascal/chapel/ValidatorContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/mainnet/CrossChainContract
Normal file
1
core/systemcontracts/pascal/mainnet/CrossChainContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/mainnet/GovHubContract
Normal file
1
core/systemcontracts/pascal/mainnet/GovHubContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/mainnet/GovTokenContract
Normal file
1
core/systemcontracts/pascal/mainnet/GovTokenContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/mainnet/GovernorContract
Normal file
1
core/systemcontracts/pascal/mainnet/GovernorContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/mainnet/LightClientContract
Normal file
1
core/systemcontracts/pascal/mainnet/LightClientContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/mainnet/RelayerHubContract
Normal file
1
core/systemcontracts/pascal/mainnet/RelayerHubContract
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/mainnet/SlashContract
Normal file
1
core/systemcontracts/pascal/mainnet/SlashContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/mainnet/StakeCreditContract
Normal file
1
core/systemcontracts/pascal/mainnet/StakeCreditContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/mainnet/StakeHubContract
Normal file
1
core/systemcontracts/pascal/mainnet/StakeHubContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/mainnet/StakingContract
Normal file
1
core/systemcontracts/pascal/mainnet/StakingContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/mainnet/SystemRewardContract
Normal file
1
core/systemcontracts/pascal/mainnet/SystemRewardContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/mainnet/TimelockContract
Normal file
1
core/systemcontracts/pascal/mainnet/TimelockContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/mainnet/TokenHubContract
Normal file
1
core/systemcontracts/pascal/mainnet/TokenHubContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/mainnet/TokenManagerContract
Normal file
1
core/systemcontracts/pascal/mainnet/TokenManagerContract
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/mainnet/ValidatorContract
Normal file
1
core/systemcontracts/pascal/mainnet/ValidatorContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/rialto/CrossChainContract
Normal file
1
core/systemcontracts/pascal/rialto/CrossChainContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/rialto/GovHubContract
Normal file
1
core/systemcontracts/pascal/rialto/GovHubContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/rialto/GovTokenContract
Normal file
1
core/systemcontracts/pascal/rialto/GovTokenContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/rialto/GovernorContract
Normal file
1
core/systemcontracts/pascal/rialto/GovernorContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/rialto/LightClientContract
Normal file
1
core/systemcontracts/pascal/rialto/LightClientContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/rialto/RelayerHubContract
Normal file
1
core/systemcontracts/pascal/rialto/RelayerHubContract
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/rialto/SlashContract
Normal file
1
core/systemcontracts/pascal/rialto/SlashContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/rialto/StakeCreditContract
Normal file
1
core/systemcontracts/pascal/rialto/StakeCreditContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/rialto/StakeHubContract
Normal file
1
core/systemcontracts/pascal/rialto/StakeHubContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/rialto/StakingContract
Normal file
1
core/systemcontracts/pascal/rialto/StakingContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/rialto/SystemRewardContract
Normal file
1
core/systemcontracts/pascal/rialto/SystemRewardContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/rialto/TimelockContract
Normal file
1
core/systemcontracts/pascal/rialto/TimelockContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/rialto/TokenHubContract
Normal file
1
core/systemcontracts/pascal/rialto/TokenHubContract
Normal file
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/rialto/TokenManagerContract
Normal file
1
core/systemcontracts/pascal/rialto/TokenManagerContract
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
core/systemcontracts/pascal/rialto/ValidatorContract
Normal file
1
core/systemcontracts/pascal/rialto/ValidatorContract
Normal file
File diff suppressed because one or more lines are too long
168
core/systemcontracts/pascal/types.go
Normal file
168
core/systemcontracts/pascal/types.go
Normal file
@@ -0,0 +1,168 @@
|
|||||||
|
package pascal
|
||||||
|
|
||||||
|
import _ "embed"
|
||||||
|
|
||||||
|
// contract codes for Mainnet upgrade
|
||||||
|
var (
|
||||||
|
|
||||||
|
//go:embed mainnet/ValidatorContract
|
||||||
|
MainnetValidatorContract string
|
||||||
|
|
||||||
|
//go:embed mainnet/SlashContract
|
||||||
|
MainnetSlashContract string
|
||||||
|
|
||||||
|
//go:embed mainnet/SystemRewardContract
|
||||||
|
MainnetSystemRewardContract string
|
||||||
|
|
||||||
|
//go:embed mainnet/LightClientContract
|
||||||
|
MainnetLightClientContract string
|
||||||
|
|
||||||
|
//go:embed mainnet/TokenHubContract
|
||||||
|
MainnetTokenHubContract string
|
||||||
|
|
||||||
|
//go:embed mainnet/RelayerIncentivizeContract
|
||||||
|
MainnetRelayerIncentivizeContract string
|
||||||
|
|
||||||
|
//go:embed mainnet/RelayerHubContract
|
||||||
|
MainnetRelayerHubContract string
|
||||||
|
|
||||||
|
//go:embed mainnet/GovHubContract
|
||||||
|
MainnetGovHubContract string
|
||||||
|
|
||||||
|
//go:embed mainnet/TokenManagerContract
|
||||||
|
MainnetTokenManagerContract string
|
||||||
|
|
||||||
|
//go:embed mainnet/CrossChainContract
|
||||||
|
MainnetCrossChainContract string
|
||||||
|
|
||||||
|
//go:embed mainnet/StakingContract
|
||||||
|
MainnetStakingContract string
|
||||||
|
|
||||||
|
//go:embed mainnet/StakeHubContract
|
||||||
|
MainnetStakeHubContract string
|
||||||
|
|
||||||
|
//go:embed mainnet/StakeCreditContract
|
||||||
|
MainnetStakeCreditContract string
|
||||||
|
|
||||||
|
//go:embed mainnet/GovernorContract
|
||||||
|
MainnetGovernorContract string
|
||||||
|
|
||||||
|
//go:embed mainnet/GovTokenContract
|
||||||
|
MainnetGovTokenContract string
|
||||||
|
|
||||||
|
//go:embed mainnet/TimelockContract
|
||||||
|
MainnetTimelockContract string
|
||||||
|
|
||||||
|
//go:embed mainnet/TokenRecoverPortalContract
|
||||||
|
MainnetTokenRecoverPortalContract string
|
||||||
|
)
|
||||||
|
|
||||||
|
// contract codes for Chapel upgrade
|
||||||
|
var (
|
||||||
|
|
||||||
|
//go:embed chapel/ValidatorContract
|
||||||
|
ChapelValidatorContract string
|
||||||
|
|
||||||
|
//go:embed chapel/SlashContract
|
||||||
|
ChapelSlashContract string
|
||||||
|
|
||||||
|
//go:embed chapel/SystemRewardContract
|
||||||
|
ChapelSystemRewardContract string
|
||||||
|
|
||||||
|
//go:embed chapel/LightClientContract
|
||||||
|
ChapelLightClientContract string
|
||||||
|
|
||||||
|
//go:embed chapel/TokenHubContract
|
||||||
|
ChapelTokenHubContract string
|
||||||
|
|
||||||
|
//go:embed chapel/RelayerIncentivizeContract
|
||||||
|
ChapelRelayerIncentivizeContract string
|
||||||
|
|
||||||
|
//go:embed chapel/RelayerHubContract
|
||||||
|
ChapelRelayerHubContract string
|
||||||
|
|
||||||
|
//go:embed chapel/GovHubContract
|
||||||
|
ChapelGovHubContract string
|
||||||
|
|
||||||
|
//go:embed chapel/TokenManagerContract
|
||||||
|
ChapelTokenManagerContract string
|
||||||
|
|
||||||
|
//go:embed chapel/CrossChainContract
|
||||||
|
ChapelCrossChainContract string
|
||||||
|
|
||||||
|
//go:embed chapel/StakingContract
|
||||||
|
ChapelStakingContract string
|
||||||
|
|
||||||
|
//go:embed chapel/StakeHubContract
|
||||||
|
ChapelStakeHubContract string
|
||||||
|
|
||||||
|
//go:embed chapel/StakeCreditContract
|
||||||
|
ChapelStakeCreditContract string
|
||||||
|
|
||||||
|
//go:embed chapel/GovernorContract
|
||||||
|
ChapelGovernorContract string
|
||||||
|
|
||||||
|
//go:embed chapel/GovTokenContract
|
||||||
|
ChapelGovTokenContract string
|
||||||
|
|
||||||
|
//go:embed chapel/TimelockContract
|
||||||
|
ChapelTimelockContract string
|
||||||
|
|
||||||
|
//go:embed chapel/TokenRecoverPortalContract
|
||||||
|
ChapelTokenRecoverPortalContract string
|
||||||
|
)
|
||||||
|
|
||||||
|
// contract codes for Rialto upgrade
|
||||||
|
var (
|
||||||
|
|
||||||
|
//go:embed rialto/ValidatorContract
|
||||||
|
RialtoValidatorContract string
|
||||||
|
|
||||||
|
//go:embed rialto/SlashContract
|
||||||
|
RialtoSlashContract string
|
||||||
|
|
||||||
|
//go:embed rialto/SystemRewardContract
|
||||||
|
RialtoSystemRewardContract string
|
||||||
|
|
||||||
|
//go:embed rialto/LightClientContract
|
||||||
|
RialtoLightClientContract string
|
||||||
|
|
||||||
|
//go:embed rialto/TokenHubContract
|
||||||
|
RialtoTokenHubContract string
|
||||||
|
|
||||||
|
//go:embed rialto/RelayerIncentivizeContract
|
||||||
|
RialtoRelayerIncentivizeContract string
|
||||||
|
|
||||||
|
//go:embed rialto/RelayerHubContract
|
||||||
|
RialtoRelayerHubContract string
|
||||||
|
|
||||||
|
//go:embed rialto/GovHubContract
|
||||||
|
RialtoGovHubContract string
|
||||||
|
|
||||||
|
//go:embed rialto/TokenManagerContract
|
||||||
|
RialtoTokenManagerContract string
|
||||||
|
|
||||||
|
//go:embed rialto/CrossChainContract
|
||||||
|
RialtoCrossChainContract string
|
||||||
|
|
||||||
|
//go:embed rialto/StakingContract
|
||||||
|
RialtoStakingContract string
|
||||||
|
|
||||||
|
//go:embed rialto/StakeHubContract
|
||||||
|
RialtoStakeHubContract string
|
||||||
|
|
||||||
|
//go:embed rialto/StakeCreditContract
|
||||||
|
RialtoStakeCreditContract string
|
||||||
|
|
||||||
|
//go:embed rialto/GovernorContract
|
||||||
|
RialtoGovernorContract string
|
||||||
|
|
||||||
|
//go:embed rialto/GovTokenContract
|
||||||
|
RialtoGovTokenContract string
|
||||||
|
|
||||||
|
//go:embed rialto/TimelockContract
|
||||||
|
RialtoTimelockContract string
|
||||||
|
|
||||||
|
//go:embed rialto/TokenRecoverPortalContract
|
||||||
|
RialtoTokenRecoverPortalContract string
|
||||||
|
)
|
||||||
@@ -20,6 +20,7 @@ import (
|
|||||||
"github.com/ethereum/go-ethereum/core/systemcontracts/mirror"
|
"github.com/ethereum/go-ethereum/core/systemcontracts/mirror"
|
||||||
"github.com/ethereum/go-ethereum/core/systemcontracts/moran"
|
"github.com/ethereum/go-ethereum/core/systemcontracts/moran"
|
||||||
"github.com/ethereum/go-ethereum/core/systemcontracts/niels"
|
"github.com/ethereum/go-ethereum/core/systemcontracts/niels"
|
||||||
|
"github.com/ethereum/go-ethereum/core/systemcontracts/pascal"
|
||||||
"github.com/ethereum/go-ethereum/core/systemcontracts/planck"
|
"github.com/ethereum/go-ethereum/core/systemcontracts/planck"
|
||||||
"github.com/ethereum/go-ethereum/core/systemcontracts/plato"
|
"github.com/ethereum/go-ethereum/core/systemcontracts/plato"
|
||||||
"github.com/ethereum/go-ethereum/core/systemcontracts/ramanujan"
|
"github.com/ethereum/go-ethereum/core/systemcontracts/ramanujan"
|
||||||
@@ -82,6 +83,8 @@ var (
|
|||||||
haberFixUpgrade = make(map[string]*Upgrade)
|
haberFixUpgrade = make(map[string]*Upgrade)
|
||||||
|
|
||||||
bohrUpgrade = make(map[string]*Upgrade)
|
bohrUpgrade = make(map[string]*Upgrade)
|
||||||
|
|
||||||
|
pascalUpgrade = make(map[string]*Upgrade)
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -773,18 +776,275 @@ func init() {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
bohrUpgrade[rialtoNet] = &Upgrade{
|
pascalUpgrade[mainNet] = &Upgrade{
|
||||||
UpgradeName: "bohr",
|
UpgradeName: "pascal",
|
||||||
Configs: []*UpgradeConfig{
|
Configs: []*UpgradeConfig{
|
||||||
{
|
{
|
||||||
ContractAddr: common.HexToAddress(ValidatorContract),
|
ContractAddr: common.HexToAddress(ValidatorContract),
|
||||||
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/398c9364aad5261c1ecd90ac3ab2df89b65c45e3",
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
Code: bohr.RialtoValidatorContract,
|
Code: pascal.MainnetValidatorContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(SlashContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.MainnetSlashContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(SystemRewardContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.MainnetSystemRewardContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(LightClientContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.MainnetLightClientContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(TokenHubContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.MainnetTokenHubContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(RelayerIncentivizeContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.MainnetRelayerIncentivizeContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(RelayerHubContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.MainnetRelayerHubContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(GovHubContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.MainnetGovHubContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(TokenManagerContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.MainnetTokenManagerContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(CrossChainContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.MainnetCrossChainContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(StakingContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.MainnetStakingContract,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ContractAddr: common.HexToAddress(StakeHubContract),
|
ContractAddr: common.HexToAddress(StakeHubContract),
|
||||||
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/398c9364aad5261c1ecd90ac3ab2df89b65c45e3",
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
Code: bohr.RialtoStakeHubContract,
|
Code: pascal.MainnetStakeHubContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(StakeCreditContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.MainnetStakeCreditContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(GovernorContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.MainnetGovernorContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(GovTokenContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.MainnetGovTokenContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(TimelockContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.MainnetTimelockContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(TokenRecoverPortalContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.MainnetTokenRecoverPortalContract,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
pascalUpgrade[chapelNet] = &Upgrade{
|
||||||
|
UpgradeName: "pascal",
|
||||||
|
Configs: []*UpgradeConfig{
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(ValidatorContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.ChapelValidatorContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(SlashContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.ChapelSlashContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(SystemRewardContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.ChapelSystemRewardContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(LightClientContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.ChapelLightClientContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(TokenHubContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.ChapelTokenHubContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(RelayerIncentivizeContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.ChapelRelayerIncentivizeContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(RelayerHubContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.ChapelRelayerHubContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(GovHubContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.ChapelGovHubContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(TokenManagerContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.ChapelTokenManagerContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(CrossChainContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.ChapelCrossChainContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(StakingContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.ChapelStakingContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(StakeHubContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.ChapelStakeHubContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(StakeCreditContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.ChapelStakeCreditContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(GovernorContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.ChapelGovernorContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(GovTokenContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.ChapelGovTokenContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(TimelockContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.ChapelTimelockContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(TokenRecoverPortalContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.ChapelTokenRecoverPortalContract,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
pascalUpgrade[rialtoNet] = &Upgrade{
|
||||||
|
UpgradeName: "pascal",
|
||||||
|
Configs: []*UpgradeConfig{
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(ValidatorContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.RialtoValidatorContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(SlashContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.RialtoSlashContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(SystemRewardContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.RialtoSystemRewardContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(LightClientContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.RialtoLightClientContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(TokenHubContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.RialtoTokenHubContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(RelayerIncentivizeContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.RialtoRelayerIncentivizeContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(RelayerHubContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.RialtoRelayerHubContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(GovHubContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.RialtoGovHubContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(TokenManagerContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.RialtoTokenManagerContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(CrossChainContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.RialtoCrossChainContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(StakingContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.RialtoStakingContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(StakeHubContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.RialtoStakeHubContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(StakeCreditContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.RialtoStakeCreditContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(GovernorContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.RialtoGovernorContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(GovTokenContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.RialtoGovTokenContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(TimelockContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.RialtoTimelockContract,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ContractAddr: common.HexToAddress(TokenRecoverPortalContract),
|
||||||
|
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/d1564095cca3bfbd303a5e3de2ad90e719d12564",
|
||||||
|
Code: pascal.RialtoTokenRecoverPortalContract,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -873,6 +1133,10 @@ func UpgradeBuildInSystemContract(config *params.ChainConfig, blockNumber *big.I
|
|||||||
applySystemContractUpgrade(bohrUpgrade[network], blockNumber, statedb, logger)
|
applySystemContractUpgrade(bohrUpgrade[network], blockNumber, statedb, logger)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if config.IsOnPascal(blockNumber, lastBlockTime, blockTime) {
|
||||||
|
applySystemContractUpgrade(pascalUpgrade[network], blockNumber, statedb, logger)
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
apply other upgrades
|
apply other upgrades
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
# - A constraint describing the requirements of the law, called "require"
|
# - A constraint describing the requirements of the law, called "require"
|
||||||
# * Implementations are transliterated into functions that operate as well on
|
# * Implementations are transliterated into functions that operate as well on
|
||||||
# algebraic input points, and are called once per combination of branches
|
# algebraic input points, and are called once per combination of branches
|
||||||
# exectured. Each execution returns:
|
# executed. Each execution returns:
|
||||||
# - A constraint describing the assumptions this implementation requires
|
# - A constraint describing the assumptions this implementation requires
|
||||||
# (such as Z1=1), called "assumeFormula"
|
# (such as Z1=1), called "assumeFormula"
|
||||||
# - A constraint describing the assumptions this specific branch requires,
|
# - A constraint describing the assumptions this specific branch requires,
|
||||||
|
|||||||
@@ -193,11 +193,16 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
|
|||||||
chainConfig.CancunTime = config.OverridePassedForkTime
|
chainConfig.CancunTime = config.OverridePassedForkTime
|
||||||
chainConfig.HaberTime = config.OverridePassedForkTime
|
chainConfig.HaberTime = config.OverridePassedForkTime
|
||||||
chainConfig.HaberFixTime = config.OverridePassedForkTime
|
chainConfig.HaberFixTime = config.OverridePassedForkTime
|
||||||
|
chainConfig.BohrTime = config.OverridePassedForkTime
|
||||||
overrides.OverridePassedForkTime = config.OverridePassedForkTime
|
overrides.OverridePassedForkTime = config.OverridePassedForkTime
|
||||||
}
|
}
|
||||||
if config.OverrideBohr != nil {
|
if config.OverridePascal != nil {
|
||||||
chainConfig.BohrTime = config.OverrideBohr
|
chainConfig.PascalTime = config.OverridePascal
|
||||||
overrides.OverrideBohr = config.OverrideBohr
|
overrides.OverridePascal = config.OverridePascal
|
||||||
|
}
|
||||||
|
if config.OverridePrague != nil {
|
||||||
|
chainConfig.PragueTime = config.OverridePrague
|
||||||
|
overrides.OverridePrague = config.OverridePrague
|
||||||
}
|
}
|
||||||
if config.OverrideVerkle != nil {
|
if config.OverrideVerkle != nil {
|
||||||
chainConfig.VerkleTime = config.OverrideVerkle
|
chainConfig.VerkleTime = config.OverrideVerkle
|
||||||
|
|||||||
@@ -191,8 +191,11 @@ type Config struct {
|
|||||||
// OverridePassedForkTime
|
// OverridePassedForkTime
|
||||||
OverridePassedForkTime *uint64 `toml:",omitempty"`
|
OverridePassedForkTime *uint64 `toml:",omitempty"`
|
||||||
|
|
||||||
// OverrideBohr (TODO: remove after the fork)
|
// OverridePascal (TODO: remove after the fork)
|
||||||
OverrideBohr *uint64 `toml:",omitempty"`
|
OverridePascal *uint64 `toml:",omitempty"`
|
||||||
|
|
||||||
|
// OverridePrague (TODO: remove after the fork)
|
||||||
|
OverridePrague *uint64 `toml:",omitempty"`
|
||||||
|
|
||||||
// OverrideVerkle (TODO: remove after the fork)
|
// OverrideVerkle (TODO: remove after the fork)
|
||||||
OverrideVerkle *uint64 `toml:",omitempty"`
|
OverrideVerkle *uint64 `toml:",omitempty"`
|
||||||
|
|||||||
@@ -70,8 +70,9 @@ func (c Config) MarshalTOML() (interface{}, error) {
|
|||||||
RPCGasCap uint64
|
RPCGasCap uint64
|
||||||
RPCEVMTimeout time.Duration
|
RPCEVMTimeout time.Duration
|
||||||
RPCTxFeeCap float64
|
RPCTxFeeCap float64
|
||||||
OverridePassedForkTime *uint64 `toml:",omitempty"`
|
OverridePassedForkTime *uint64 `toml:",omitempty"`
|
||||||
OverrideBohr *uint64 `toml:",omitempty"`
|
OverridePascal *uint64 `toml:",omitempty"`
|
||||||
|
OverridePrague *uint64 `toml:",omitempty"`
|
||||||
OverrideVerkle *uint64 `toml:",omitempty"`
|
OverrideVerkle *uint64 `toml:",omitempty"`
|
||||||
BlobExtraReserve uint64
|
BlobExtraReserve uint64
|
||||||
}
|
}
|
||||||
@@ -130,7 +131,8 @@ func (c Config) MarshalTOML() (interface{}, error) {
|
|||||||
enc.RPCEVMTimeout = c.RPCEVMTimeout
|
enc.RPCEVMTimeout = c.RPCEVMTimeout
|
||||||
enc.RPCTxFeeCap = c.RPCTxFeeCap
|
enc.RPCTxFeeCap = c.RPCTxFeeCap
|
||||||
enc.OverridePassedForkTime = c.OverridePassedForkTime
|
enc.OverridePassedForkTime = c.OverridePassedForkTime
|
||||||
enc.OverrideBohr = c.OverrideBohr
|
enc.OverridePascal = c.OverridePascal
|
||||||
|
enc.OverridePrague = c.OverridePrague
|
||||||
enc.OverrideVerkle = c.OverrideVerkle
|
enc.OverrideVerkle = c.OverrideVerkle
|
||||||
enc.BlobExtraReserve = c.BlobExtraReserve
|
enc.BlobExtraReserve = c.BlobExtraReserve
|
||||||
return &enc, nil
|
return &enc, nil
|
||||||
@@ -192,8 +194,9 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
|
|||||||
RPCGasCap *uint64
|
RPCGasCap *uint64
|
||||||
RPCEVMTimeout *time.Duration
|
RPCEVMTimeout *time.Duration
|
||||||
RPCTxFeeCap *float64
|
RPCTxFeeCap *float64
|
||||||
OverridePassedForkTime *uint64 `toml:",omitempty"`
|
OverridePassedForkTime *uint64 `toml:",omitempty"`
|
||||||
OverrideBohr *uint64 `toml:",omitempty"`
|
OverridePascal *uint64 `toml:",omitempty"`
|
||||||
|
OverridePrague *uint64 `toml:",omitempty"`
|
||||||
OverrideVerkle *uint64 `toml:",omitempty"`
|
OverrideVerkle *uint64 `toml:",omitempty"`
|
||||||
BlobExtraReserve *uint64
|
BlobExtraReserve *uint64
|
||||||
}
|
}
|
||||||
@@ -363,8 +366,11 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
|
|||||||
if dec.OverridePassedForkTime != nil {
|
if dec.OverridePassedForkTime != nil {
|
||||||
c.OverridePassedForkTime = dec.OverridePassedForkTime
|
c.OverridePassedForkTime = dec.OverridePassedForkTime
|
||||||
}
|
}
|
||||||
if dec.OverrideBohr != nil {
|
if dec.OverridePascal != nil {
|
||||||
c.OverrideBohr = dec.OverrideBohr
|
c.OverridePascal = dec.OverridePascal
|
||||||
|
}
|
||||||
|
if dec.OverridePrague != nil {
|
||||||
|
c.OverridePrague = dec.OverridePrague
|
||||||
}
|
}
|
||||||
if dec.OverrideVerkle != nil {
|
if dec.OverrideVerkle != nil {
|
||||||
c.OverrideVerkle = dec.OverrideVerkle
|
c.OverrideVerkle = dec.OverrideVerkle
|
||||||
|
|||||||
@@ -321,21 +321,14 @@ func newHandler(config *handlerConfig) (*handler, error) {
|
|||||||
|
|
||||||
broadcastBlockWithCheck := func(block *types.Block, propagate bool) {
|
broadcastBlockWithCheck := func(block *types.Block, propagate bool) {
|
||||||
if propagate {
|
if propagate {
|
||||||
checkErrs := make(chan error, 2)
|
if !(block.Header().WithdrawalsHash == nil && block.Withdrawals() == nil) &&
|
||||||
|
!(block.Header().EmptyWithdrawalsHash() && block.Withdrawals() != nil && len(block.Withdrawals()) == 0) {
|
||||||
go func() {
|
log.Error("Propagated block has invalid withdrawals")
|
||||||
checkErrs <- core.ValidateListsInBody(block)
|
return
|
||||||
}()
|
}
|
||||||
go func() {
|
if err := core.IsDataAvailable(h.chain, block); err != nil {
|
||||||
checkErrs <- core.IsDataAvailable(h.chain, block)
|
log.Error("Propagating block with invalid sidecars", "number", block.Number(), "hash", block.Hash(), "err", err)
|
||||||
}()
|
return
|
||||||
|
|
||||||
for i := 0; i < cap(checkErrs); i++ {
|
|
||||||
err := <-checkErrs
|
|
||||||
if err != nil {
|
|
||||||
log.Error("Propagating invalid block", "number", block.Number(), "hash", block.Hash(), "err", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
h.BroadcastBlock(block, propagate)
|
h.BroadcastBlock(block, propagate)
|
||||||
|
|||||||
@@ -155,6 +155,9 @@ var (
|
|||||||
HaberTime: newUint64(1718863500), // 2024-06-20 06:05:00 AM UTC
|
HaberTime: newUint64(1718863500), // 2024-06-20 06:05:00 AM UTC
|
||||||
HaberFixTime: newUint64(1727316120), // 2024-09-26 02:02:00 AM UTC
|
HaberFixTime: newUint64(1727316120), // 2024-09-26 02:02:00 AM UTC
|
||||||
BohrTime: newUint64(1727317200), // 2024-09-26 02:20:00 AM UTC
|
BohrTime: newUint64(1727317200), // 2024-09-26 02:20:00 AM UTC
|
||||||
|
// TODO
|
||||||
|
PascalTime: nil,
|
||||||
|
PragueTime: nil,
|
||||||
|
|
||||||
Parlia: &ParliaConfig{
|
Parlia: &ParliaConfig{
|
||||||
Period: 3,
|
Period: 3,
|
||||||
@@ -196,6 +199,9 @@ var (
|
|||||||
HaberTime: newUint64(1716962820), // 2024-05-29 06:07:00 AM UTC
|
HaberTime: newUint64(1716962820), // 2024-05-29 06:07:00 AM UTC
|
||||||
HaberFixTime: newUint64(1719986788), // 2024-07-03 06:06:28 AM UTC
|
HaberFixTime: newUint64(1719986788), // 2024-07-03 06:06:28 AM UTC
|
||||||
BohrTime: newUint64(1724116996), // 2024-08-20 01:23:16 AM UTC
|
BohrTime: newUint64(1724116996), // 2024-08-20 01:23:16 AM UTC
|
||||||
|
// TODO
|
||||||
|
PascalTime: nil,
|
||||||
|
PragueTime: nil,
|
||||||
|
|
||||||
Parlia: &ParliaConfig{
|
Parlia: &ParliaConfig{
|
||||||
Period: 3,
|
Period: 3,
|
||||||
@@ -238,6 +244,9 @@ var (
|
|||||||
HaberTime: newUint64(0),
|
HaberTime: newUint64(0),
|
||||||
HaberFixTime: newUint64(0),
|
HaberFixTime: newUint64(0),
|
||||||
BohrTime: newUint64(0),
|
BohrTime: newUint64(0),
|
||||||
|
// TODO: set them to `0` when passed on the mainnet
|
||||||
|
PascalTime: nil,
|
||||||
|
PragueTime: nil,
|
||||||
|
|
||||||
Parlia: &ParliaConfig{
|
Parlia: &ParliaConfig{
|
||||||
Period: 3,
|
Period: 3,
|
||||||
@@ -517,6 +526,7 @@ type ChainConfig struct {
|
|||||||
HaberTime *uint64 `json:"haberTime,omitempty"` // Haber switch time (nil = no fork, 0 = already on haber)
|
HaberTime *uint64 `json:"haberTime,omitempty"` // Haber switch time (nil = no fork, 0 = already on haber)
|
||||||
HaberFixTime *uint64 `json:"haberFixTime,omitempty"` // HaberFix switch time (nil = no fork, 0 = already on haberFix)
|
HaberFixTime *uint64 `json:"haberFixTime,omitempty"` // HaberFix switch time (nil = no fork, 0 = already on haberFix)
|
||||||
BohrTime *uint64 `json:"bohrTime,omitempty"` // Bohr switch time (nil = no fork, 0 = already on bohr)
|
BohrTime *uint64 `json:"bohrTime,omitempty"` // Bohr switch time (nil = no fork, 0 = already on bohr)
|
||||||
|
PascalTime *uint64 `json:"pascalTime,omitempty"` // Pascal switch time (nil = no fork, 0 = already on pascal)
|
||||||
PragueTime *uint64 `json:"pragueTime,omitempty"` // Prague switch time (nil = no fork, 0 = already on prague)
|
PragueTime *uint64 `json:"pragueTime,omitempty"` // Prague switch time (nil = no fork, 0 = already on prague)
|
||||||
VerkleTime *uint64 `json:"verkleTime,omitempty"` // Verkle switch time (nil = no fork, 0 = already on verkle)
|
VerkleTime *uint64 `json:"verkleTime,omitempty"` // Verkle switch time (nil = no fork, 0 = already on verkle)
|
||||||
|
|
||||||
@@ -637,7 +647,17 @@ func (c *ChainConfig) String() string {
|
|||||||
BohrTime = big.NewInt(0).SetUint64(*c.BohrTime)
|
BohrTime = big.NewInt(0).SetUint64(*c.BohrTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
return fmt.Sprintf("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Ramanujan: %v, Niels: %v, MirrorSync: %v, Bruno: %v, Berlin: %v, YOLO v3: %v, CatalystBlock: %v, London: %v, ArrowGlacier: %v, MergeFork:%v, Euler: %v, Gibbs: %v, Nano: %v, Moran: %v, Planck: %v,Luban: %v, Plato: %v, Hertz: %v, Hertzfix: %v, ShanghaiTime: %v, KeplerTime: %v, FeynmanTime: %v, FeynmanFixTime: %v, CancunTime: %v, HaberTime: %v, HaberFixTime: %v, BohrTime: %v, Engine: %v}",
|
var PascalTime *big.Int
|
||||||
|
if c.PascalTime != nil {
|
||||||
|
PascalTime = big.NewInt(0).SetUint64(*c.PascalTime)
|
||||||
|
}
|
||||||
|
|
||||||
|
var PragueTime *big.Int
|
||||||
|
if c.PragueTime != nil {
|
||||||
|
PragueTime = big.NewInt(0).SetUint64(*c.PragueTime)
|
||||||
|
}
|
||||||
|
|
||||||
|
return fmt.Sprintf("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Ramanujan: %v, Niels: %v, MirrorSync: %v, Bruno: %v, Berlin: %v, YOLO v3: %v, CatalystBlock: %v, London: %v, ArrowGlacier: %v, MergeFork:%v, Euler: %v, Gibbs: %v, Nano: %v, Moran: %v, Planck: %v,Luban: %v, Plato: %v, Hertz: %v, Hertzfix: %v, ShanghaiTime: %v, KeplerTime: %v, FeynmanTime: %v, FeynmanFixTime: %v, CancunTime: %v, HaberTime: %v, HaberFixTime: %v, BohrTime: %v, PascalTime: %v, PragueTime: %v, Engine: %v}",
|
||||||
c.ChainID,
|
c.ChainID,
|
||||||
c.HomesteadBlock,
|
c.HomesteadBlock,
|
||||||
c.DAOForkBlock,
|
c.DAOForkBlock,
|
||||||
@@ -677,6 +697,8 @@ func (c *ChainConfig) String() string {
|
|||||||
HaberTime,
|
HaberTime,
|
||||||
HaberFixTime,
|
HaberFixTime,
|
||||||
BohrTime,
|
BohrTime,
|
||||||
|
PascalTime,
|
||||||
|
PragueTime,
|
||||||
engine,
|
engine,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -977,6 +999,20 @@ func (c *ChainConfig) IsOnBohr(currentBlockNumber *big.Int, lastBlockTime uint64
|
|||||||
return !c.IsBohr(lastBlockNumber, lastBlockTime) && c.IsBohr(currentBlockNumber, currentBlockTime)
|
return !c.IsBohr(lastBlockNumber, lastBlockTime) && c.IsBohr(currentBlockNumber, currentBlockTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IsPascal returns whether time is either equal to the Pascal fork time or greater.
|
||||||
|
func (c *ChainConfig) IsPascal(num *big.Int, time uint64) bool {
|
||||||
|
return c.IsLondon(num) && isTimestampForked(c.PascalTime, time)
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsOnPascal returns whether currentBlockTime is either equal to the Pascal fork time or greater firstly.
|
||||||
|
func (c *ChainConfig) IsOnPascal(currentBlockNumber *big.Int, lastBlockTime uint64, currentBlockTime uint64) bool {
|
||||||
|
lastBlockNumber := new(big.Int)
|
||||||
|
if currentBlockNumber.Cmp(big.NewInt(1)) >= 0 {
|
||||||
|
lastBlockNumber.Sub(currentBlockNumber, big.NewInt(1))
|
||||||
|
}
|
||||||
|
return !c.IsPascal(lastBlockNumber, lastBlockTime) && c.IsPascal(currentBlockNumber, currentBlockTime)
|
||||||
|
}
|
||||||
|
|
||||||
// IsPrague returns whether num is either equal to the Prague fork time or greater.
|
// IsPrague returns whether num is either equal to the Prague fork time or greater.
|
||||||
func (c *ChainConfig) IsPrague(num *big.Int, time uint64) bool {
|
func (c *ChainConfig) IsPrague(num *big.Int, time uint64) bool {
|
||||||
return c.IsLondon(num) && isTimestampForked(c.PragueTime, time)
|
return c.IsLondon(num) && isTimestampForked(c.PragueTime, time)
|
||||||
@@ -1043,7 +1079,8 @@ func (c *ChainConfig) CheckConfigForkOrder() error {
|
|||||||
{name: "haberTime", timestamp: c.HaberTime},
|
{name: "haberTime", timestamp: c.HaberTime},
|
||||||
{name: "haberFixTime", timestamp: c.HaberFixTime},
|
{name: "haberFixTime", timestamp: c.HaberFixTime},
|
||||||
{name: "bohrTime", timestamp: c.BohrTime},
|
{name: "bohrTime", timestamp: c.BohrTime},
|
||||||
{name: "pragueTime", timestamp: c.PragueTime, optional: true},
|
{name: "pascalTime", timestamp: c.PascalTime},
|
||||||
|
{name: "pragueTime", timestamp: c.PragueTime},
|
||||||
{name: "verkleTime", timestamp: c.VerkleTime, optional: true},
|
{name: "verkleTime", timestamp: c.VerkleTime, optional: true},
|
||||||
} {
|
} {
|
||||||
if lastFork.name != "" {
|
if lastFork.name != "" {
|
||||||
@@ -1199,6 +1236,9 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, headNumber *big.Int,
|
|||||||
if isForkTimestampIncompatible(c.BohrTime, newcfg.BohrTime, headTimestamp) {
|
if isForkTimestampIncompatible(c.BohrTime, newcfg.BohrTime, headTimestamp) {
|
||||||
return newTimestampCompatError("Bohr fork timestamp", c.BohrTime, newcfg.BohrTime)
|
return newTimestampCompatError("Bohr fork timestamp", c.BohrTime, newcfg.BohrTime)
|
||||||
}
|
}
|
||||||
|
if isForkTimestampIncompatible(c.PascalTime, newcfg.PascalTime, headTimestamp) {
|
||||||
|
return newTimestampCompatError("Pascal fork timestamp", c.PascalTime, newcfg.PascalTime)
|
||||||
|
}
|
||||||
if isForkTimestampIncompatible(c.PragueTime, newcfg.PragueTime, headTimestamp) {
|
if isForkTimestampIncompatible(c.PragueTime, newcfg.PragueTime, headTimestamp) {
|
||||||
return newTimestampCompatError("Prague fork timestamp", c.PragueTime, newcfg.PragueTime)
|
return newTimestampCompatError("Prague fork timestamp", c.PragueTime, newcfg.PragueTime)
|
||||||
}
|
}
|
||||||
@@ -1382,7 +1422,7 @@ type Rules struct {
|
|||||||
IsHertz bool
|
IsHertz bool
|
||||||
IsHertzfix bool
|
IsHertzfix bool
|
||||||
IsShanghai, IsKepler, IsFeynman, IsCancun, IsHaber bool
|
IsShanghai, IsKepler, IsFeynman, IsCancun, IsHaber bool
|
||||||
IsBohr, IsPrague, IsVerkle bool
|
IsBohr, IsPascal, IsPrague, IsVerkle bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rules ensures c's ChainID is not nil.
|
// Rules ensures c's ChainID is not nil.
|
||||||
@@ -1419,6 +1459,7 @@ func (c *ChainConfig) Rules(num *big.Int, isMerge bool, timestamp uint64) Rules
|
|||||||
IsCancun: c.IsCancun(num, timestamp),
|
IsCancun: c.IsCancun(num, timestamp),
|
||||||
IsHaber: c.IsHaber(num, timestamp),
|
IsHaber: c.IsHaber(num, timestamp),
|
||||||
IsBohr: c.IsBohr(num, timestamp),
|
IsBohr: c.IsBohr(num, timestamp),
|
||||||
|
IsPascal: c.IsPascal(num, timestamp),
|
||||||
IsPrague: c.IsPrague(num, timestamp),
|
IsPrague: c.IsPrague(num, timestamp),
|
||||||
IsVerkle: c.IsVerkle(num, timestamp),
|
IsVerkle: c.IsVerkle(num, timestamp),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import (
|
|||||||
const (
|
const (
|
||||||
VersionMajor = 1 // Major version component of the current release
|
VersionMajor = 1 // Major version component of the current release
|
||||||
VersionMinor = 4 // Minor version component of the current release
|
VersionMinor = 4 // Minor version component of the current release
|
||||||
VersionPatch = 14 // Patch version component of the current release
|
VersionPatch = 15 // Patch version component of the current release
|
||||||
VersionMeta = "" // Version metadata to append to the version string
|
VersionMeta = "" // Version metadata to append to the version string
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user