Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions chain33.fork.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ ForkEVMFixOverflow=0
ForkEVMSuicidePayer=0
# Revertible value transfers; -1 keeps the fix off (resolved to MaxHeight)
ForkEVMTransferRevert=-1
# Ethereum EVM compatibility set (opcodes/gas/CREATE); -1 keeps it off
ForkEVMCompat=-1


[fork.sub.evmxgo]
Expand Down
2 changes: 2 additions & 0 deletions chain33.para.toml
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,8 @@ ForkEVMFixOverflow=0
ForkEVMSuicidePayer=0
# Revertible value transfers; -1 keeps the fix off (resolved to MaxHeight)
ForkEVMTransferRevert=-1
# Ethereum EVM compatibility set (opcodes/gas/CREATE); -1 keeps it off
ForkEVMCompat=-1

[fork.sub.blackwhite]
Enable=0
Expand Down
6 changes: 6 additions & 0 deletions plugin/consensus/dpos/dpos.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,12 @@ OuterLoop:
return
}

// genesisDoc 由 NewClient 传入,缺省时无法构造验证人集合,直接返回而不是空指针崩溃
if client.genesisDoc == nil {
dposlog.Error("StartConsensus", "msg", "genesis doc is nil, skip consensus")
return
}

var valMgr ValidatorMgr
valMgrTmp, err := MakeGenesisValidatorMgr(client.genesisDoc)
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions plugin/dapp/evm/cmd/ci2/chain33.proxyminer.toml
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,8 @@ ForkEVMFixOverflow=0
ForkEVMSuicidePayer=0
# Revertible value transfers; -1 keeps the fix off (resolved to MaxHeight)
ForkEVMTransferRevert=-1
# Ethereum EVM compatibility set (opcodes/gas/CREATE); -1 keeps it off
ForkEVMCompat=-1

[fork.sub.evmxgo]
Enable=0
Expand Down
29 changes: 21 additions & 8 deletions plugin/dapp/evm/cmd/ci2/docker-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,14 @@ function withdrawTicketBalance(){
local balance=$(echo "${result}" | jq -r ".balance")
tbalance=$(printf "%.0f\n" $balance)
echo "ticket balance:${tbalance},addr:${m4normalAddr},timestamp:$(date +"%s")"
# The ticket balance also grows with mining rewards, so it cannot be used as
# the expected coin balance after the withdraw. Compare the coins delta.
local coinsBefore
coinsBefore=$(${CLI} account balance -a "${m4normalAddr}" -e coins | jq -er ".balance") || {
echo "failed to read coins balance before withdraw"
exit 1
}
echo "coins balance before withdraw:${coinsBefore}"

local withdrawTx=$( ${CLI} coins withdraw -e ticket -a 100000 -n "take test money")
echo "withdraw rawTx:${withdrawTx}"
Expand All @@ -409,14 +417,19 @@ function withdrawTicketBalance(){
fi
echo "withdraw hash:${hash}"
chain33_QueryTx ${hash} ${MCli}
#check coins balance
local result=$(${CLI} account balance -a "${m4normalAddr}" -e coins)
local balance=$(echo "${result}" | jq -r ".balance")
echo "coldminer addr coins balance:${balance}"
local checkBalance=$(printf "%.0f\n" $balance)
echo "checkBalance: $(("${checkBalance}")) "
if [ $((checkBalance)) -lt $((tbalance)) ]; then
exit 1
#check coins balance: the withdraw moves 100000 into the coins account minus the
#transaction fee (~0.1), so require a lower bound with margin instead of an exact
#value: the boundary is sensitive to floating-point rounding of the balances.
local coinsAfter
coinsAfter=$(${CLI} account balance -a "${m4normalAddr}" -e coins | jq -er ".balance") || {
echo "failed to read coins balance after withdraw"
exit 1
}
echo "coldminer addr coins balance after withdraw:${coinsAfter}"
if ! awk -v before="${coinsBefore}" -v after="${coinsAfter}" \
'BEGIN { exit !((after - before) >= 99999) }'; then
echo "withdraw balance check failed: before=${coinsBefore} after=${coinsAfter}"
exit 1
fi

}
Expand Down
Loading
Loading