Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
c39c0013
Commit
c39c0013
authored
Oct 09, 2021
by
mdj33
Committed by
33cn
Oct 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add fork
parent
e1cfbf6f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
0 deletions
+10
-0
chain33.para.toml
chain33.para.toml
+2
-0
parasync.go
plugin/consensus/para/parasync.go
+5
-0
type.go
plugin/dapp/paracross/types/type.go
+3
-0
No files found.
chain33.para.toml
View file @
c39c0013
...
...
@@ -293,6 +293,8 @@ ForkParaAssetTransferRbk=0
ForkParaSupervision
=
0
#仅平行链适用,开启挖矿交易的高度,已有代码版本可能未在0高度开启挖矿,需要设置这个高度,新版本默认从0开启挖矿,通过交易配置分阶段奖励
ForkParaFullMinerHeight
=
0
#仅平行链适用,在旧的版本中计算blockTxHash输入高度为0,需要在此高度后统一采用新的主链高度值,旧的版本需要设置此分叉高度,新版本缺省为0即可
ForkParaRootHash
=
0
[fork.sub.evm]
Enable
=
0
...
...
plugin/consensus/para/parasync.go
View file @
c39c0013
...
...
@@ -437,7 +437,12 @@ func (client *blockSyncClient) addBlock(lastBlock *types.Block, localBlock *pt.P
if
cfg
.
IsFork
(
newBlock
.
GetMainHeight
(),
"ForkRootHash"
)
{
newBlock
.
Txs
=
types
.
TransactionSort
(
newBlock
.
Txs
)
}
//在之前版本中CalcMerkleRoot的height是未初始化的MainHeight,等于0,在这个平行链的分叉ForkParaRootHash高度后统一采用新高度
if
cfg
.
IsFork
(
newBlock
.
Height
,
pt
.
ForkParaRootHash
)
{
newBlock
.
TxHash
=
merkle
.
CalcMerkleRoot
(
cfg
,
newBlock
.
GetMainHeight
(),
newBlock
.
Txs
)
}
else
{
newBlock
.
TxHash
=
merkle
.
CalcMerkleRoot
(
cfg
,
0
,
newBlock
.
Txs
)
}
err
=
client
.
writeBlock
(
lastBlock
.
StateHash
,
&
newBlock
)
...
...
plugin/dapp/paracross/types/type.go
View file @
c39c0013
...
...
@@ -34,6 +34,8 @@ var (
ForkParaSupervision
=
"ForkParaSupervision"
// ForkParaFullMinerHeight 平行链全挖矿开启高度
ForkParaFullMinerHeight
=
"ForkParaFullMinerHeight"
// ForkParaRootHash 平行链按照ForkRootHash计算rootHash高度,在之前版本中平行链侧计算txRootHash没有提供正确的主链高度计算,需要分叉
ForkParaRootHash
=
"ForkParaRootHash"
// ParaConsSubConf sub
ParaConsSubConf
=
"consensus.sub.para"
...
...
@@ -67,6 +69,7 @@ func InitFork(cfg *types.Chain33Config) {
//只在平行链启用
cfg
.
RegisterDappFork
(
ParaX
,
ForkParaSelfConsStages
,
types
.
MaxHeight
)
cfg
.
RegisterDappFork
(
ParaX
,
ForkParaFullMinerHeight
,
types
.
MaxHeight
)
cfg
.
RegisterDappFork
(
ParaX
,
ForkParaRootHash
,
types
.
MaxHeight
)
}
//InitExecutor ...
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment