-
Notifications
You must be signed in to change notification settings - Fork 3
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
Enable DAO Proposal to execute Arbitray Tx #19
Conversation
…'s and GetStake calls
@@ -306,6 +324,30 @@ func (m *blockBuilder) Shutdown() { | |||
m.vm.ctx.Lock.Lock() | |||
} | |||
|
|||
// getStakerToReward return the staker txID to remove from the primary network |
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.
this documentation seems to have been copied from another method
@@ -215,6 +215,34 @@ type Client interface { | |||
GetBlock(ctx context.Context, blockID ids.ID, options ...rpc.Option) ([]byte, error) | |||
// GetConfiguration returns genesis information of the primary network | |||
GetConfiguration(ctx context.Context) (*GetConfigurationReply, error) | |||
// // AddDaoProposal adds a new Proposal created by this nodeId. |
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.
hey @DerTiedemann , these were the commented out methods I was referring to..
return errStartTimeBeforeEndTime | ||
} | ||
|
||
if d.Thresh > 0 { |
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.
that should be rather
d.Thresh <= 0
case daoProposal.Voted(tx.NodeID): | ||
return nil, nil, fmt.Errorf("node %s has already voted on proposal: %s", tx.NodeID.String(), tx.ProposalID.String()) | ||
case daoProposal.DaoProposalTx().StartTime().After(validator.AddValidatorTx().StartTime()): | ||
return nil, nil, fmt.Errorf("node %s only became a validator after the proposal started and is thus not eligible to participate", tx.NodeID.String()) |
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.
That should rather be:
daoProposal.DaoProposalTx().StartTime().Before(validator.AddValidatorTx().StartTime()):
return state == ProposalStateConcluded | ||
} | ||
|
||
// StartTime is the time that this validator will enter the validator set |
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.
this documentation is obviously copied from validator.go and does not describe its real purpose
Damm, i just noticed, that there is am implicit requirement for the Ins of both the Submit and WrappedTx to be disjunct. Which the current stake function does not care about... sadge |
I converted i back to a draft as i found some bugs that are game breaking, ill need to discuss with @evlekht how to proceed.
Ill need to see if there is a way to sidestep this issue. |
superceded by #269 |
Goals
Allow more or less (anything the implements a specific tx type) to be executed as a ConcludeProposalTx that will only be executed when the vote has passed. Also allow the Implementing Tx to verify the ProposalConfiguration to make sure it can reject parameters that are invalid. E.g. not high enough threshold or invalid durration of Proposal.
Non-Goals
Allow for multiple outcomes in the same proposal
Implementation
Newly/Adjusted Tx:
Caveats
The proposedTx is checked at submit time, but the state can change while the proposal is active. If the proposalTx becomes invalid while the Proposal is invalid the proposal concludes as normal and ignores the failure. That might not be desireable but the easiest way of handeling it atm.
The AddValidator proposal will not be able to submited outside of a ConcludeProposalTx