-
Notifications
You must be signed in to change notification settings - Fork 346
Prepare next proposal #4586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prepare next proposal #4586
Conversation
|
@@ -378,6 +378,10 @@ func (sdb *stateDB) ReadView(name string) (interface{}, error) { | |||
return sdb.protocolView.Read(name) | |||
} | |||
|
|||
func (sdb *stateDB) StateReaderAt(header *block.Header) (protocol.StateReader, error) { | |||
panic("implement me") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will implement after #4581
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the main idea looks ok. Let's split it into multiple PRs:
- refactor
getblockhash
andgetblocktime
- refactor the mint part, move logic into consensus
- early proposal
func WithConsensusRoundCtx(ctx context.Context, round ConsensusRoundCtx) context.Context { | ||
return context.WithValue(ctx, consensusRoundContextKey{}, round) | ||
} | ||
|
||
func MustGetConsensusRoundCtx(ctx context.Context) ConsensusRoundCtx { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if necessary, move to package rolldpos
} | ||
|
||
// MintNewBlock creates a new block with given actions | ||
func (fc *forkChain) MintNewBlock(ctx context.Context) (*block.Block, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add parameters:
StartTime time.Time
EncodedProposer string
PrevHash hash.Hash256
Round
is not in use, Height
is always equal to tipHeight + 1
Mint(ctx context.Context) (*block.Block, error) | ||
ReceiveBlock(*block.Block) error | ||
Init(hash.Hash256) | ||
AddProposal(*block.Block) error | ||
Block(hash.Hash256) *block.Block |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the BlockBuilderFactory
defined here doesn't need to contain all the functions.
@@ -513,12 +513,16 @@ func (builder *Builder) createBlockchain(forSubChain, forTest bool) blockchain.B | |||
} else { | |||
chainOpts = append(chainOpts, blockchain.BlockValidatorOption(builder.cs.factory)) | |||
} | |||
consensusCfg := consensusfsm.NewConsensusConfig(builder.cfg.Consensus.RollDPoS.FSM, builder.cfg.DardanellesUpgrade, builder.cfg.Genesis, builder.cfg.Consensus.RollDPoS.Delay) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
single node mode may have problem. so, we need to rethink about the usage of BlockTimeCalculatorBuilder
.
|
||
var mintOpts []factory.MintOption | ||
mintOpts := []factory.MintOption{factory.WithPrivateKeyOption(builder.cfg.Chain.ProducerPrivateKey())} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moving private key to consensus may be a better way.
Description
two major changes introduced:
base #4582
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: