Skip to content

Commit

Permalink
chore: address pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
acud committed Jun 13, 2024
1 parent 4966611 commit 435b11c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ operating your own PoET and want to use certificate authentication please refer
ATXs. This vulnerability allows an attacker to claim rewards for a full tick amount although they should not be
eligible for them.

* [#6031](https://github.com/spacemeshos/go-spacemesh/pull/6031) Fixed an edge case where the storage units might have
changed after the initial PoST was generated but before the first ATX has been emitted, invalidating the initial PoST.
The node will now try to verify the initial PoST and regenerate it if necessary.

## Release v1.5.7

### Improvements
Expand Down
7 changes: 3 additions & 4 deletions activation/e2e/activation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ func Test_BuilderWithMultipleClients(t *testing.T) {
).Times(totalAtxs)

t.Cleanup(func() { assert.NoError(t, verifier.Close()) })
v := activation.NewValidator(db, poetDb, cfg, opts.Scrypt, verifier)
tab := activation.NewBuilder(
conf,
db,
Expand All @@ -212,7 +211,7 @@ func Test_BuilderWithMultipleClients(t *testing.T) {
syncer,
logger,
activation.WithPoetConfig(poetCfg),
activation.WithValidator(v),
activation.WithValidator(validator),
activation.WithPostStates(postStates),
activation.WithPoets(client),
)
Expand Down Expand Up @@ -251,7 +250,7 @@ func Test_BuilderWithMultipleClients(t *testing.T) {
require.Equal(t, sig.NodeID(), *atx.NodeID)
require.Equal(t, goldenATX, atx.PositioningATXID)
require.NotNil(t, atx.VRFNonce)
err := v.VRFNonce(
err := validator.VRFNonce(
sig.NodeID(),
commitment,
uint64(*atx.VRFNonce),
Expand All @@ -263,7 +262,7 @@ func Test_BuilderWithMultipleClients(t *testing.T) {
require.Nil(t, atx.VRFNonce)
require.Equal(t, previous, atx.PositioningATXID)
}
_, err = v.NIPost(
_, err = validator.NIPost(
context.Background(),
sig.NodeID(),
commitment,
Expand Down
9 changes: 3 additions & 6 deletions activation/nipost.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,9 @@ func (nb *NIPostBuilder) Proof(
}

retries = 0

// we check whether an initial post is included, if so, it means
// we land under the possible edge case where the storage units
// have changed between the initial PoST and the upcoming one (initial ATX
// still not published)
// TODO change to postChallenge.InitialPost
// we check whether an initial post is included in the challenge
// if so, we verify it to still be valid before creating the post
// e.g. the PoST size might have changed
if postChallenge != nil && postChallenge.InitialPost != nil {
info, err := client.Info(ctx)
if errors.Is(err, ErrPostClientClosed) {
Expand Down

0 comments on commit 435b11c

Please sign in to comment.