Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Enable Bdls configuration in channel #10

Draft
wants to merge 49 commits into
base: release-bdls
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
daf8020
adding bdls package to main branch
ahmed82 Jan 31, 2023
f9bc298
adding BDLS configuration
ahmed82 Feb 24, 2023
6d4d632
adding BDLS configuration
ahmed82 Feb 24, 2023
0926090
extracting the hight from the block
ahmed82 Feb 26, 2023
e48cd13
Merge pull request #11 from BDLS-bft/include-bloackHight
ahmed82 Feb 26, 2023
1fa3dd5
Update the Consenter.go file and make use of the HandleChain() function
ahmed82 Mar 1, 2023
1259b97
adding the block creater file to bdls backage
ahmed82 Mar 1, 2023
793256c
Add the logic for the Chain.configure function.
ahmed82 Mar 2, 2023
1324513
Merge pull request #12 from ahmed82/main-bdls
ahmed82 Mar 8, 2023
80b6ab8
create the struct gc TODO practise for create a snapshotting into a …
ahmed82 Mar 9, 2023
f0288ad
prpose the marshel envelope message to the current BDLS node
ahmed82 Mar 9, 2023
64298b1
fix RPC interface implementation reusing the comentted error fun
ahmed82 Mar 9, 2023
517da41
Merge pull request #13 from ahmed82/main-bdls
ahmed82 Mar 9, 2023
77f0209
Merge pull request #14 from ahmed82/main-bdls
ahmed82 Mar 9, 2023
3bc4949
On branch main-bdls
ahmed82 Mar 10, 2023
112fca9
Merge branch 'BDLS-bft:main-bdls' into main-bdls
ahmed82 Mar 10, 2023
605179b
Merge pull request #15 from ahmed82/main-bdls
ahmed82 Mar 10, 2023
9ad5f72
point to lisr of Identity rather that list of pointer
ahmed82 Mar 12, 2023
8b84355
Merge pull request #16 from ahmed82/main-bdls
ahmed82 Mar 12, 2023
ec9822d
adding run method infra
ahmed82 Mar 21, 2023
8e992eb
enable RPC.SendSubmit in the submit()
ahmed82 Mar 24, 2023
94219bb
restart configuring the run in go routin
ahmed82 Mar 28, 2023
eb908f3
propose the data the consensus and update the blovk height with new h…
ahmed82 Mar 28, 2023
3a35866
enable using the Run() in go routin
ahmed82 Mar 28, 2023
c168cdd
remove the null pram from the consenter interface
ahmed82 Mar 29, 2023
145975c
init adding the BDLS Participants
ahmed82 Mar 31, 2023
e4b7f4b
Merge pull request #17 from ahmed82/bdlsIdentity
ahmed82 Mar 31, 2023
05b7a29
cleanup consensus task example
ahmed82 Apr 1, 2023
4fd164a
Merge pull request #18 from ahmed82/bdlsIdentity
ahmed82 Apr 1, 2023
4ef97f4
refresh BDLS release, using the SubmitRequest function
ahmed82 Apr 8, 2023
55cdba3
Merge pull request #19 from ahmed82/bdlsIdentity
ahmed82 Apr 8, 2023
f3873c2
move to local proto
ahmed82 Apr 21, 2023
249b823
move the Proto files to the BDLS repo to avoid vendor issue
ahmed82 May 2, 2023
dfd22ee
Merge pull request #1 from ahmed82/localproto
ahmed82 May 2, 2023
c8d30d7
Merge pull request #20 from ahmed82/main-bdls
ahmed82 May 2, 2023
56a32f4
adding the initializeBdlsConsenter function - TODO reuse the icr
ahmed82 May 17, 2023
77eed22
Create CITATION.cff
ahmed82 Jun 2, 2023
9d176e2
fix Fabric BDLS profile
ahmed82 Jun 20, 2023
a92c87e
include bdls ordrer config in configtx_template
ahmed82 Jun 20, 2023
efec7fb
fix the makefile
ahmed82 Jun 21, 2023
0b462e7
revert the configtx.yaml file
ahmed82 Jun 21, 2023
cfa0dfb
update the configtx yaml file
ahmed82 Jun 22, 2023
ffcd4ce
Merge pull request #2 from ahmed82/localproto
ahmed82 Jun 22, 2023
75a327d
Merge pull request #21 from ahmed82/main-bdls
ahmed82 Jun 22, 2023
7262ee8
Fix the config file for Bdls
ahmed82 Jun 26, 2023
f050303
Merge pull request #3 from ahmed82/localproto
ahmed82 Jun 26, 2023
223156f
switch the ordererType BDLS to static string in internal/configtxgen/…
ahmed82 Jun 26, 2023
70bb00e
Merge pull request #4 from ahmed82/localproto
ahmed82 Jun 26, 2023
5159353
Merge pull request #22 from ahmed82/main-bdls
ahmed82 Jun 29, 2023
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
Prev Previous commit
Next Next commit
propose the data the consensus and update the blovk height with new h…
…eight
  • Loading branch information
ahmed82 committed Mar 28, 2023
commit eb908f3117a40050d3090bc511d639b7178fd780
62 changes: 35 additions & 27 deletions orderer/consensus/bdls/chain.go
Original file line number Diff line number Diff line change
@@ -22,13 +22,16 @@ import (
"bytes"
"context"
"crypto/ecdsa"
"encoding/hex"
"encoding/pem"
"fmt"
"log"
"sync"
"time"

"code.cloudfoundry.org/clock"
"github.com/BDLS-bft/bdls"
"github.com/BDLS-bft/bdls/crypto/blake2b"
"github.com/hyperledger/fabric-protos-go/common"
"github.com/hyperledger/fabric-protos-go/orderer"
bdlspb "github.com/hyperledger/fabric-protos-go/orderer/bdls"
@@ -449,8 +452,8 @@ func (c *Chain) sealBlock(newHeight uint64, newRound uint64, newState bdls.State
}

// seal the the proof in block header
header.Decision = bts

//header.Decision = bts
c.logger.Info("Seal block at header:%d , and:%d ", header, bts)
// broadcast the mined block
//mined := newblock.WithSeal(header)

@@ -747,7 +750,7 @@ func (c *Chain) run() {
ticking = false
}

var soft bdls.State
//var soft bdls.State
submitC := c.submitC
var bc *blockCreator

@@ -768,11 +771,15 @@ func (c *Chain) run() {
select {
case b := <-ch:
data := protoutil.MarshalOrPanic(b)
if err := c.consensus.Propose(b.Header.DataHash.Bytes()); err != nil {
c.logger.Errorf("Failed to propose block [%d] to BDLS and discard %d blocks in queue: %s", b.Header.Number, len(ch), err)
return
c.consensus.Propose(data)

newHeight, newRound, newState := c.consensus.CurrentState()
if newHeight > b.Header.Number {
h := blake2b.Sum256(newState)
log.Printf("<decide> at height:%v round:%v hash:%v", newHeight, newRound, hex.EncodeToString(h[:]))
b.Header.Number = newHeight
}
c.logger.Debugf("Proposed block [%d] to raft consensus", b.Header.Number)
c.logger.Debugf("Proposed block [%d] to BDLS consensus", b.Header.Number)

case <-ctx.Done():
c.logger.Debugf("Quit proposing blocks, discarded %d blocks in the queue", len(ch))
@@ -822,28 +829,29 @@ func (c *Chain) run() {
case app := <-c.applyC:

c.apply(app.entries)
// No need to check for leader we asume is always true as all BDLS node need to commit the message
// if true {
msgInflight := c.opts.BdlsID > c.appliedIndex
if msgInflight {
c.logger.Debugf("There are in flight blocks, new leader should not serve requests")
//continue
}

if true {
msgInflight := c.opts.BdlsID > c.appliedIndex
if msgInflight {
c.logger.Debugf("There are in flight blocks, new leader should not serve requests")
//continue
}

if c.configInflight {
c.logger.Debugf("There is config block in flight, new leader should not serve requests")
//continue
}
if c.configInflight {
c.logger.Debugf("There is config block in flight, new leader should not serve requests")
//continue
}

c.logger.Infof("Start accepting requests as BDLS Node at block [%d]", c.lastBlock.Header.Number)
bc = &blockCreator{
hash: protoutil.BlockHeaderHash(c.lastBlock.Header),
number: c.lastBlock.Header.Number,
logger: c.logger,
}
submitC = c.submitC
//c.justElected = false
} else if c.configInflight {
c.logger.Infof("Start accepting requests as BDLS Node at block [%d]", c.lastBlock.Header.Number)
bc = &blockCreator{
hash: protoutil.BlockHeaderHash(c.lastBlock.Header),
number: c.lastBlock.Header.Number,
logger: c.logger,
}
submitC = c.submitC
//c.justElected = false
//}
if c.configInflight {
c.logger.Info("Config block or ConfChange in flight, pause accepting transaction")
submitC = nil
} else if c.blockInflight < c.opts.MaxInflightBlocks {