-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Merge the client and the runner. The distinction was unclear and the client/runner/module tended to reach into each other. This change merges the client/runner and then separates the new "runner" from the module as much as possible. 2. Completely stop/discard the runner when rebootstrapping. The new logic carefully waits for all components to stop before moving on. 3. Simplify locking and make sure we take the locks where appropriate. 4. Merge bootstrap and re-configure logic. The dynamic manifest client no longer cares about _when_ a manifest should be applied, it simply gives it to the module (F3) and let's F3 us its normal bootstrap logic. Finally, I've improved the tests to: 1. Always on exit (checking for errors). 2. Never fail from goroutines. 3. Correctly wait for manifest changes (previously, it would wait for at least one node to change manifests). NOTEs: 1. This removes the ability to reconfig without rebootstrap, but preserves the ability to _pause_ without rebootstrap. 2. This causes bootstrap to start at the time the bootstrap epoch _should_ have happened instead of starting at the next non-null epoch. In practice, this should behave better as all nodes will start at the same time (and will look back 900 epochs anyways).
- Loading branch information
Showing
13 changed files
with
897 additions
and
1,005 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package ec | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/filecoin-project/go-f3/certs" | ||
"github.com/filecoin-project/go-f3/gpbft" | ||
) | ||
|
||
func WithModifiedPower(backend Backend, delta []certs.PowerTableDelta) Backend { | ||
return &withModifiedPower{ | ||
Backend: backend, | ||
delta: delta, | ||
} | ||
} | ||
|
||
type withModifiedPower struct { | ||
Backend | ||
delta []certs.PowerTableDelta | ||
} | ||
|
||
func (b *withModifiedPower) GetPowerTable(ctx context.Context, ts gpbft.TipSetKey) (gpbft.PowerEntries, error) { | ||
pt, err := b.Backend.GetPowerTable(ctx, ts) | ||
if err != nil { | ||
return nil, fmt.Errorf("getting power table: %w", err) | ||
} | ||
return certs.ApplyPowerTableDiffs(pt, b.delta) | ||
} |
Oops, something went wrong.