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

[Merged by Bors] - hare3 implementation #4765

Closed
wants to merge 70 commits into from

Conversation

dshulyak
Copy link
Contributor

@dshulyak dshulyak commented Aug 2, 2023

implementation is splitted into several files:

protocol.go

implements protocol execution logic close to the original paper, baring several differences in syntax and things that we need but are not covered in the paper. interface for interacting with protocol has two methods:

  • onMessage
  • next(active bool)

only active nodes are publishing messages

types.go

types that go over the wire

type Message struct {
	Body
	Sender    types.NodeID
	Signature types.EdSignature
}

type Body struct {
	Layer types.LayerID
	IterRound
	Value       Value
	Eligibility types.HareEligibility
}

type Value struct {
	// Proposals is set in messages for preround and propose rounds.
	Proposals []types.ProposalID `scale:"max=200"`
	// Reference is set in messages for commit and notify rounds.
	Reference *types.Hash32
}

signature domain and malfeasance proof remains the same, as we don't intend to run more than one hare in parallel.

hare.go

integrates protocol with spacemesh data model, network, synchronization. manages multiple protocol instances (one per layer).

legacy_oracle.go

wrapper for oracle that uses active set in consensus, it outputs maximum grades for identities that are in consensus and 0 for everyone else.

compat

intergration for weakcoin and hare results to avoid changes across the app

remaining:

  • test commit with different locked value in protocol_test.go (remaining for 100%)

@dshulyak
Copy link
Contributor Author

dshulyak commented Aug 2, 2023

bors try

bors bot added a commit that referenced this pull request Aug 2, 2023
@codecov
Copy link

codecov bot commented Aug 2, 2023

Codecov Report

Merging #4765 (2c86042) into develop (2ffb4e0) will increase coverage by 0.3%.
The diff coverage is 84.0%.

@@            Coverage Diff            @@
##           develop   #4765     +/-   ##
=========================================
+ Coverage     76.7%   77.0%   +0.3%     
=========================================
  Files          256     263      +7     
  Lines        29665   30528    +863     
=========================================
+ Hits         22772   23531    +759     
- Misses        5423    5500     +77     
- Partials      1470    1497     +27     
Files Changed Coverage Δ
hare/config/config.go 100.0% <ø> (ø)
hare/hare.go 74.6% <0.0%> (-0.6%) ⬇️
hare3/compat/result.go 0.0% <0.0%> (ø)
hare3/compat/weakcoin.go 0.0% <0.0%> (ø)
hare3/tracer.go 0.0% <0.0%> (ø)
node/node.go 63.1% <0.0%> (-1.3%) ⬇️
codec/codec.go 54.9% <50.0%> (-0.3%) ⬇️
hare3/legacy_oracle.go 73.1% <73.1%> (ø)
hare3/hare.go 84.5% <84.5%> (ø)
common/types/malfeasance.go 52.8% <85.7%> (+3.1%) ⬆️
... and 5 more

... and 5 files with indirect coverage changes

@bors
Copy link

bors bot commented Aug 2, 2023

try

Build failed:

@dshulyak
Copy link
Contributor Author

dshulyak commented Aug 2, 2023

image

tx count in 21 and 22 layers is a bit off, might be mistimed somehow

@dshulyak
Copy link
Contributor Author

dshulyak commented Aug 5, 2023

bors try

bors bot added a commit that referenced this pull request Aug 5, 2023
@bors
Copy link

bors bot commented Aug 5, 2023

try

Build failed:

@dshulyak
Copy link
Contributor Author

dshulyak commented Aug 5, 2023

bors try

bors bot added a commit that referenced this pull request Aug 5, 2023
@bors
Copy link

bors bot commented Aug 5, 2023

try

Build failed:

@dshulyak
Copy link
Contributor Author

dshulyak commented Aug 5, 2023

bors try

bors bot added a commit that referenced this pull request Aug 5, 2023
@bors
Copy link

bors bot commented Aug 5, 2023

try

Build failed:

@dshulyak
Copy link
Contributor Author

bors merge

bors bot pushed a commit that referenced this pull request Aug 30, 2023
implementation is splitted into several files:

#### protocol.go
implements protocol execution logic close to the original paper, baring several differences in syntax and things that we need but are not covered in the paper. interface for interacting with protocol has two methods:

- onMessage
- next(active bool)

only active nodes are publishing messages

#### types.go
types that go over the wire

```go
type Message struct {
	Body
	Sender    types.NodeID
	Signature types.EdSignature
}

type Body struct {
	Layer types.LayerID
	IterRound
	Value       Value
	Eligibility types.HareEligibility
}

type Value struct {
	// Proposals is set in messages for preround and propose rounds.
	Proposals []types.ProposalID `scale:"max=200"`
	// Reference is set in messages for commit and notify rounds.
	Reference *types.Hash32
}
```

signature domain and malfeasance proof remains the same, as we don't intend to run more than one hare in parallel.

#### hare.go
integrates protocol with spacemesh data model, network, synchronization. manages multiple protocol instances (one per layer).

#### legacy_oracle.go
wrapper for oracle that uses active set in consensus, it outputs maximum grades for identities that are in consensus and 0 for everyone else.

#### compat
intergration for weakcoin and hare results to avoid changes across the app


remaining:
- [ ] test commit with different locked value in protocol_test.go (remaining for 100%)
@bors
Copy link

bors bot commented Aug 30, 2023

Build failed:

  • systest-status

@dshulyak
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Aug 30, 2023
@dshulyak
Copy link
Contributor Author

cluster was prematurely terminated. can't find any failures

@bors
Copy link

bors bot commented Aug 30, 2023

try

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@dshulyak
Copy link
Contributor Author

bors merge

bors bot pushed a commit that referenced this pull request Aug 30, 2023
implementation is splitted into several files:

#### protocol.go
implements protocol execution logic close to the original paper, baring several differences in syntax and things that we need but are not covered in the paper. interface for interacting with protocol has two methods:

- onMessage
- next(active bool)

only active nodes are publishing messages

#### types.go
types that go over the wire

```go
type Message struct {
	Body
	Sender    types.NodeID
	Signature types.EdSignature
}

type Body struct {
	Layer types.LayerID
	IterRound
	Value       Value
	Eligibility types.HareEligibility
}

type Value struct {
	// Proposals is set in messages for preround and propose rounds.
	Proposals []types.ProposalID `scale:"max=200"`
	// Reference is set in messages for commit and notify rounds.
	Reference *types.Hash32
}
```

signature domain and malfeasance proof remains the same, as we don't intend to run more than one hare in parallel.

#### hare.go
integrates protocol with spacemesh data model, network, synchronization. manages multiple protocol instances (one per layer).

#### legacy_oracle.go
wrapper for oracle that uses active set in consensus, it outputs maximum grades for identities that are in consensus and 0 for everyone else.

#### compat
intergration for weakcoin and hare results to avoid changes across the app


remaining:
- [ ] test commit with different locked value in protocol_test.go (remaining for 100%)
@bors
Copy link

bors bot commented Aug 30, 2023

Build failed:

  • systest-status

@dshulyak
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Aug 30, 2023
@bors
Copy link

bors bot commented Aug 30, 2023

try

Build failed:

@dshulyak
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Aug 30, 2023
@bors
Copy link

bors bot commented Aug 30, 2023

try

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@dshulyak
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Aug 30, 2023
@bors
Copy link

bors bot commented Aug 30, 2023

try

Build failed:

@dshulyak
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Aug 30, 2023
@bors
Copy link

bors bot commented Aug 30, 2023

try

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@dshulyak
Copy link
Contributor Author

bors merge

bors bot pushed a commit that referenced this pull request Aug 30, 2023
implementation is splitted into several files:

#### protocol.go
implements protocol execution logic close to the original paper, baring several differences in syntax and things that we need but are not covered in the paper. interface for interacting with protocol has two methods:

- onMessage
- next(active bool)

only active nodes are publishing messages

#### types.go
types that go over the wire

```go
type Message struct {
	Body
	Sender    types.NodeID
	Signature types.EdSignature
}

type Body struct {
	Layer types.LayerID
	IterRound
	Value       Value
	Eligibility types.HareEligibility
}

type Value struct {
	// Proposals is set in messages for preround and propose rounds.
	Proposals []types.ProposalID `scale:"max=200"`
	// Reference is set in messages for commit and notify rounds.
	Reference *types.Hash32
}
```

signature domain and malfeasance proof remains the same, as we don't intend to run more than one hare in parallel.

#### hare.go
integrates protocol with spacemesh data model, network, synchronization. manages multiple protocol instances (one per layer).

#### legacy_oracle.go
wrapper for oracle that uses active set in consensus, it outputs maximum grades for identities that are in consensus and 0 for everyone else.

#### compat
intergration for weakcoin and hare results to avoid changes across the app


remaining:
- [ ] test commit with different locked value in protocol_test.go (remaining for 100%)
@bors
Copy link

bors bot commented Aug 30, 2023

Pull request successfully merged into develop.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title hare3 implementation [Merged by Bors] - hare3 implementation Aug 30, 2023
@bors bors bot closed this Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants