Skip to content
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

Remove DAG based consensus #1359

Merged
merged 29 commits into from Apr 26, 2023
Merged

Remove DAG based consensus #1359

merged 29 commits into from Apr 26, 2023

Conversation

StephenButtolph
Copy link
Contributor

Why this should be merged

All consensus instances are now chain based.

How this works

Removes the Avalanche consensus engine and avalanche consensus instance.

How this was tested

CI + TODO: local testing

@StephenButtolph StephenButtolph added consensus This involves consensus cleanup Code quality improvement labels Apr 15, 2023
@StephenButtolph StephenButtolph self-assigned this Apr 15, 2023
Comment on lines -341 to -343
if err := stopVertex.Verify(ctx); err != nil {
return fmt.Errorf("failed to verify stop vertex: %w", err)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike block or tx verify, vertex verification was stateless, so this doesn't need to exist anymore

@@ -433,16 +247,6 @@ func (vtx *uniqueVertex) Height() (uint64, error) {
return vtx.v.vtx.Height(), nil
}

func (vtx *uniqueVertex) Epoch() (uint32, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was already dead code... apparently

"github.com/ava-labs/avalanchego/utils"
"github.com/ava-labs/avalanchego/utils/hashing"
)

// Builder builds a vertex given a set of parentIDs and transactions.
type Builder interface {
// Build a new vertex from the contents of a vertex
BuildVtx(ctx context.Context, parentIDs []ids.ID, txs []snowstorm.Tx) (avalanche.Vertex, error)
// Build a new stop vertex from the parents
BuildStopVtx(ctx context.Context, parentIDs []ids.ID) (avalanche.Vertex, error)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically we should be able to remove the below Build function, but it's used for testing.

Base automatically changed from linearize-on-start to dev April 25, 2023 21:23
Copy link
Contributor

@abi87 abi87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What a change. So long and thanks for all the fish

// BetaRogue to be equal. Therefore we use the more conservative
// BetaRogue value for both BetaVirtuous and BetaRogue.
//
// TODO: After the X-chain linearization use the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need this TODO?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup

@StephenButtolph StephenButtolph merged commit 59ba604 into dev Apr 26, 2023
14 checks passed
@StephenButtolph StephenButtolph deleted the remove-avalanche-consensus branch April 26, 2023 21:58
joshua-kim pushed a commit to joshua-kim/avalanchego that referenced this pull request Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code quality improvement consensus This involves consensus
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

5 participants