Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/bnb-chain/develop' into ro…
Browse files Browse the repository at this point in the history
…shan/builder
  • Loading branch information
pythonberg1997 committed Apr 11, 2024
2 parents a057245 + 51ea234 commit 7618542
Show file tree
Hide file tree
Showing 28 changed files with 1,899 additions and 314 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ truffle-test:
docker build . -f ./docker/Dockerfile --target bsc -t bsc
docker build . -f ./docker/Dockerfile.truffle -t truffle-test
docker-compose -f ./tests/truffle/docker-compose.yml up genesis
docker-compose -f ./tests/truffle/docker-compose.yml up -d bsc-rpc bsc-validator1
docker-compose -f ./tests/truffle/docker-compose.yml up -d bsc-rpc
sleep 30
docker-compose -f ./tests/truffle/docker-compose.yml up --exit-code-from truffle-test truffle-test
docker-compose -f ./tests/truffle/docker-compose.yml down
Expand Down
328 changes: 50 additions & 278 deletions README.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions consensus/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,5 @@ type PoSA interface {
GetFinalizedHeader(chain ChainHeaderReader, header *types.Header) *types.Header
VerifyVote(chain ChainHeaderReader, vote *types.VoteEnvelope) error
IsActiveValidatorAt(chain ChainHeaderReader, header *types.Header, checkVoteKeyFn func(bLSPublicKey *types.BLSPublicKey) bool) bool
SetValidator(validator common.Address)
}
11 changes: 11 additions & 0 deletions consensus/parlia/parlia.go
Original file line number Diff line number Diff line change
Expand Up @@ -1876,6 +1876,17 @@ func (p *Parlia) GetFinalizedHeader(chain consensus.ChainHeaderReader, header *t
return chain.GetHeader(snap.Attestation.SourceHash, snap.Attestation.SourceNumber)
}

// SetValidator set the validator of parlia engine
// It is used for builder
func (p *Parlia) SetValidator(val common.Address) {
if val == (common.Address{}) {
return
}
p.lock.Lock()
defer p.lock.Unlock()
p.val = val
}

// =========================== utility function ==========================
func (p *Parlia) backOffTime(snap *Snapshot, header *types.Header, val common.Address) uint64 {
if snap.inturn(val) {
Expand Down
Loading

0 comments on commit 7618542

Please sign in to comment.