This repository has been archived by the owner on Sep 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ibft controller and future msgs handling (#431)
- Loading branch information
Showing
17 changed files
with
756 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...rc/main/java/tech/pegasys/pantheon/consensus/ibft/ibftevent/IbftReceivedMessageEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright 2018 ConsenSys AG. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
package tech.pegasys.pantheon.consensus.ibft.ibftevent; | ||
|
||
import tech.pegasys.pantheon.consensus.ibft.ibftevent.IbftEvents.Type; | ||
import tech.pegasys.pantheon.ethereum.p2p.api.MessageData; | ||
|
||
public class IbftReceivedMessageEvent implements IbftEvent { | ||
|
||
private final MessageData messageData; | ||
|
||
public IbftReceivedMessageEvent(final MessageData messageData) { | ||
this.messageData = messageData; | ||
} | ||
|
||
public MessageData getMessageData() { | ||
return messageData; | ||
} | ||
|
||
@Override | ||
public Type getType() { | ||
return Type.MESSAGE; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...c/main/java/tech/pegasys/pantheon/consensus/ibft/statemachine/IbftBlockHeightManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright 2018 ConsenSys AG. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
package tech.pegasys.pantheon.consensus.ibft.statemachine; | ||
|
||
import tech.pegasys.pantheon.consensus.ibft.ConsensusRoundIdentifier; | ||
import tech.pegasys.pantheon.consensus.ibft.ibftevent.RoundExpiry; | ||
import tech.pegasys.pantheon.consensus.ibft.ibftmessagedata.CommitPayload; | ||
import tech.pegasys.pantheon.consensus.ibft.ibftmessagedata.NewRoundPayload; | ||
import tech.pegasys.pantheon.consensus.ibft.ibftmessagedata.PreparePayload; | ||
import tech.pegasys.pantheon.consensus.ibft.ibftmessagedata.ProposalPayload; | ||
import tech.pegasys.pantheon.consensus.ibft.ibftmessagedata.RoundChangePayload; | ||
import tech.pegasys.pantheon.consensus.ibft.ibftmessagedata.SignedData; | ||
|
||
/** This no-op version will be replaced with an implementation in another PR */ | ||
public class IbftBlockHeightManager { | ||
|
||
public void handleProposalMessage(final SignedData<ProposalPayload> proposalMsg) {} | ||
|
||
public void handlePrepareMessage(final SignedData<PreparePayload> prepareMsg) {} | ||
|
||
public void handleCommitMessage(final SignedData<CommitPayload> commitMsg) {} | ||
|
||
public void handleBlockTimerExpiry(final ConsensusRoundIdentifier roundIndentifier) {} | ||
|
||
public void handleRoundChangeMessage(final SignedData<RoundChangePayload> roundChangeMsg) {} | ||
|
||
public void handleNewRoundMessage(final SignedData<NewRoundPayload> newRoundMsg) {} | ||
|
||
public void start() {} | ||
|
||
public long getChainHeight() { | ||
return 0; | ||
} | ||
|
||
public void roundExpired(final RoundExpiry expired) {} | ||
} |
23 changes: 23 additions & 0 deletions
23
...java/tech/pegasys/pantheon/consensus/ibft/statemachine/IbftBlockHeightManagerFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright 2018 ConsenSys AG. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
package tech.pegasys.pantheon.consensus.ibft.statemachine; | ||
|
||
import tech.pegasys.pantheon.ethereum.core.BlockHeader; | ||
|
||
/** This no-op version will be replaced with an implementation in another PR */ | ||
public class IbftBlockHeightManagerFactory { | ||
|
||
public IbftBlockHeightManager create(final BlockHeader parentHeader) { | ||
return new IbftBlockHeightManager(); | ||
} | ||
} |
Oops, something went wrong.