Skip to content

Commit

Permalink
Merge pull request #312 from XinFinOrg/dev-upgrade
Browse files Browse the repository at this point in the history
CI Upgrade
  • Loading branch information
liam-lai authored and wanwiset25 committed Apr 1, 2024
1 parent 066adb5 commit 228a26f
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 14 deletions.
14 changes: 9 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ Describe the big picture of your changes here to communicate to the maintainers
What types of changes does your code introduce to XDC network?
_Put an `` in the boxes that apply_

- [ ] Bugfix
- [ ] New feature
- [ ] Documentation Update or any other KTLO
- [ ] Not sure (Please specify below)
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation Update (if none of the other choices apply)
- [ ] Regular KTLO or any of the maintaince work. e.g code style
- [ ] CICD Improvement

## Impacted Components
Which part of the codebase this PR will touch base on,
Expand All @@ -30,4 +32,6 @@ _Put an `✅` in the boxes once you have confirmed below actions (or provide rea
- [ ] This PR has sufficient test coverage (unit/integration test) OR I have provided reason in the PR description for not having test coverage
- [ ] Provide an end-to-end test plan in the PR description on how to manually test it on the devnet/testnet.
- [ ] Tested the backwards compatibility.
- [ ] Relevant documentation has been updated as part of this PR
- [ ] Tested with XDC nodes running this version co-exist with those running the previous version.
- [ ] Relevant documentation has been updated as part of this PR
- [ ] N/A
1 change: 1 addition & 0 deletions cicd/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dockerfile
3 changes: 1 addition & 2 deletions consensus/XDPoS/XDPoS.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,7 @@ func (x *XDPoS) GetSnapshot(chain consensus.ChainReader, header *types.Header) (
}

func (x *XDPoS) GetAuthorisedSignersFromSnapshot(chain consensus.ChainReader, header *types.Header) ([]common.Address, error) {
// Legacy V1 function
return []common.Address{}, nil
return x.EngineV2.GetSignersFromSnapshot(chain, header)
}

func (x *XDPoS) FindParentBlockToAssign(chain consensus.ChainReader, currentBlock *types.Block) *types.Block {
Expand Down
6 changes: 6 additions & 0 deletions consensus/XDPoS/engines/engine_v2/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/XinFinOrg/XDC-Subnet/accounts"
"github.com/XinFinOrg/XDC-Subnet/common"
"github.com/XinFinOrg/XDC-Subnet/consensus/XDPoS/utils"
"github.com/XinFinOrg/XDC-Subnet/consensus"
"github.com/XinFinOrg/XDC-Subnet/core/types"
"github.com/XinFinOrg/XDC-Subnet/crypto"
"github.com/XinFinOrg/XDC-Subnet/crypto/sha3"
Expand Down Expand Up @@ -157,3 +158,8 @@ func (x *XDPoS_v2) GetRoundNumber(header *types.Header) (types.Round, error) {
return decodedExtraField.Round, nil
}
}

func (x *XDPoS_v2) GetSignersFromSnapshot(chain consensus.ChainReader, header *types.Header) ([]common.Address, error) {
snap, err := x.getSnapshot(chain, header.Number.Uint64(), false)
return snap.NextEpochMasterNodes, err
}
3 changes: 3 additions & 0 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2967,6 +2967,9 @@ func GetSignersFromBlocks(b Backend, blockNumber uint64, blockHash common.Hash,
return addrs, err
}
blockData, err := b.BlockByNumber(nil, rpc.BlockNumber(i))
if err != nil {
return addrs, err
}
signTxs := engine.CacheSigningTxs(header.Hash(), blockData.Transactions())
for _, signtx := range signTxs {
blkHash := common.BytesToHash(signtx.Data()[len(signtx.Data())-32:])
Expand Down
13 changes: 6 additions & 7 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ var (
TestnetV2Configs = map[uint64]*V2Config{
Default: {
SwitchRound: 0,
CertThreshold: 3,
TimeoutSyncThreshold: 2,
TimeoutPeriod: 4,
CertThreshold: 7,
TimeoutSyncThreshold: 3,
TimeoutPeriod: 60,
MinePeriod: 2,
},
}
Expand Down Expand Up @@ -159,10 +159,9 @@ var (
Gap: 450,
FoudationWalletAddr: common.HexToAddress("xdc746249c61f5832c5eed53172776b460491bdcd5c"),
V2: &V2{
SwitchBlock: common.TIPV2SwitchBlock,
CurrentConfig: TestnetV2Configs[0],
AllConfigs: TestnetV2Configs,
SkipV2Validation: true,
SwitchBlock: common.TIPV2SwitchBlock,
CurrentConfig: TestnetV2Configs[0],
AllConfigs: TestnetV2Configs,
},
},
}
Expand Down

0 comments on commit 228a26f

Please sign in to comment.