Add long-term feedback as TODOs

pull/839/head
Eugene Kim 6 years ago
parent 7445699909
commit 2202782ab8
  1. 1
      consensus/consensus_v2.go
  2. 1
      consensus/consensus_validator.go
  3. 1
      core/rawdb/accessors_chain.go
  4. 6
      node/node.go

@ -133,6 +133,7 @@ func (consensus *Consensus) onAnnounce(msg *msg_pb.Message) {
if consensus.BlockVerifier == nil {
// do nothing
} else if err := consensus.BlockVerifier(&blockObj); err != nil {
// TODO ek – maybe we could do this in commit phase
err := ctxerror.New("block verification failed",
"blockHash", blockObj.Hash(),
).WithCause(err)

@ -95,6 +95,7 @@ func (consensus *Consensus) processAnnounceMessage(message *msg_pb.Message) {
if consensus.BlockVerifier == nil {
// do nothing
} else if err := consensus.BlockVerifier(&blockObj); err != nil {
// TODO ek – maybe we could do this in commit phase
err := ctxerror.New("block verification failed",
"blockHash", blockObj.Hash(),
).WithCause(err)

@ -340,6 +340,7 @@ func ReadBlock(db DatabaseReader, hash common.Hash, number uint64) *types.Block
func WriteBlock(db DatabaseWriter, block *types.Block) {
WriteBody(db, block.Hash(), block.NumberU64(), block.Body())
WriteHeader(db, block.Header())
// TODO ek – maybe roll the below into WriteHeader()
epoch := block.Header().Epoch
if epoch == nil {
// backward compatibility

@ -148,8 +148,9 @@ type Node struct {
// TODO: leochen, can we use multiple account for staking?
StakingAccount accounts.Account
// For test only
TestBankKeys []*ecdsa.PrivateKey
// For test only; TODO ek – remove this
TestBankKeys []*ecdsa.PrivateKey
ContractDeployerKey *ecdsa.PrivateKey
ContractDeployerCurrentNonce uint64 // The nonce of the deployer contract at current block
ContractAddresses []common.Address
@ -191,6 +192,7 @@ type Node struct {
// When for a leader to propose the next shard state,
// or for a validator to wait for a proposal before view change.
// TODO ek – replace with retry-based logic instead of delay
proposeTime time.Time
}

Loading…
Cancel
Save