Skip to content

Commit

Permalink
chore: resolve merge conflicts and fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonberg1997 committed Dec 8, 2023
1 parent 3e9e642 commit 8f3c525
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ on:
- develop

pull_request:

branches:
- master
- develop

jobs:
unit-test:
Expand Down Expand Up @@ -45,5 +47,3 @@ jobs:
run: |
go mod download
make geth
4 changes: 3 additions & 1 deletion .github/workflows/commit-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ on:
- develop

pull_request:

branches:
- master
- develop

jobs:
commitlint:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
- develop

pull_request:
branches:
- master
- develop

jobs:
truffle-test:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ on:
- develop

pull_request:

branches:
- master
- develop

jobs:
golang-lint:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ on:
- develop

pull_request:

branches:
- master
- develop

jobs:
unit-test:
Expand Down Expand Up @@ -48,6 +50,5 @@ jobs:
ANDROID_HOME: "" # Skip android test
run: |
git submodule update --init --depth 1 --recursive
go mod tidy
go mod download
make test
2 changes: 1 addition & 1 deletion cmd/geth/blsaccountcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ func blsAccountGenerateProof(ctx *cli.Context) error {
utils.Fatalf("BLS wallet not exists.")
}

walletPassword := utils.GetPassPhraseWithList("Enter the password for your BLS wallet.", false, 0, GetBLSPassword(ctx))
walletPassword := utils.GetPassPhraseWithList("Enter the password for your BLS wallet.", false, 0, utils.MakePasswordListFromPath(ctx.String(utils.BLSPasswordFileFlag.Name)))
w, err := wallet.OpenWallet(context.Background(), &wallet.Config{
WalletDir: walletDir,
WalletPassword: walletPassword,
Expand Down
48 changes: 48 additions & 0 deletions consensus/parlia/abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -4481,6 +4481,54 @@ const stakeABI = `
],
"stateMutability": "view"
},
{
"type": "function",
"name": "getValidatorRewardRecord",
"inputs": [
{
"name": "operatorAddress",
"type": "address",
"internalType": "address"
},
{
"name": "dayIndex",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "getValidatorTotalPooledBNBRecord",
"inputs": [
{
"name": "operatorAddress",
"type": "address",
"internalType": "address"
},
{
"name": "dayIndex",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "initialize",
Expand Down
16 changes: 8 additions & 8 deletions consensus/parlia/feynmanfork.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,14 @@ func getTopValidatorsByVotingPower(validatorItems []ValidatorItem, maxElectedVal
hp := &validatorHeap
heap.Init(hp)

length := int(maxElectedValidators.Int64())
if length > len(validatorHeap) {
length = len(validatorHeap)
}
eValidators := make([]common.Address, length)
eVotingPowers := make([]uint64, length)
eVoteAddrs := make([][]byte, length)
for i := 0; i < length; i++ {
topN := int(maxElectedValidators.Int64())
if topN > len(validatorHeap) {
topN = len(validatorHeap)
}
eValidators := make([]common.Address, topN)
eVotingPowers := make([]uint64, topN)
eVoteAddrs := make([][]byte, topN)
for i := 0; i < topN; i++ {
item := heap.Pop(hp).(ValidatorItem)
eValidators[i] = item.address
// as the decimal in BNB Beacon Chain is 1e8 and in BNB Smart Chain is 1e18, we need to divide it by 1e10
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions core/vm/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -1453,6 +1453,9 @@ func (c *verifyDoubleSignEvidence) Run(input []byte) ([]byte, error) {
// check sig
msgHash1 := types.SealHash(header1, evidence.ChainId)
msgHash2 := types.SealHash(header2, evidence.ChainId)
if bytes.Equal(msgHash1.Bytes(), msgHash2.Bytes()) {
return nil, ErrExecutionReverted
}
pubkey1, err := secp256k1.RecoverPubkey(msgHash1.Bytes(), sig1)
if err != nil {
return nil, ErrExecutionReverted
Expand Down

0 comments on commit 8f3c525

Please sign in to comment.