Skip to content

Conversation

@esuwu
Copy link
Contributor

@esuwu esuwu commented Nov 11, 2025

No description provided.

@esuwu esuwu requested a review from alexeykiselev November 24, 2025 09:13
func (s Stub) SignTransactionWith(pk crypto.PublicKey, tx proto.Transaction) error {
panic("Stub.SignTransactionWith: Unsupported operation")
func (s Stub) SignTransactionWith(_ crypto.PublicKey, _ proto.Transaction) error {
panic("Stub.SignTransactionWith: Unsopported operation")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the word “unsOpported” exist?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

return crypto.PublicKey{}, ErrPublicKeyNotFound
}

func (a *EmbeddedWalletImpl) BlsPairByWavesPK(publicKey crypto.PublicKey) (bls.SecretKey, bls.PublicKey, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

"Bls" should be "BLS".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed


// FindEndorserPKsByIndexes returns BLS endorser public keys using
// commitment indexes stored in FinalizationVoting.EndorserIndexes.
func (c *commitments) FindEndorserPKsByIndexes(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why "PKs" and "indexes", not "PK" and "index", the function returns only one public key and accepts only one index.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

"github.com/wavesplatform/gowaves/pkg/proto"
)

const finalizationKey = "finalization"
Copy link
Collaborator

Choose a reason for hiding this comment

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

All keys have to be introduced in

commitmentKeyPrefix

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

var ErrNoFinalizationHistory = errors.New("no finalization in history")

type finalizationItem struct {
Block proto.BlockHeader `cbor:"0,keyasint,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need to store block header second time here, can be retrieved by height or blockID.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

func (fr *finalizationRecord) unmarshalBinary(data []byte) error { return cbor.Unmarshal(data, fr) }

type finalizations struct {
hs *historyStorage
Copy link
Collaborator

Choose a reason for hiding this comment

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

As we discussed the finalization storage should not be a history storage. In case of using history the rollback will happen automatically, but the idea of finalization records that they are irreversible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The finalization now contains only one item, I kept the history storage. Moved it to the other PR

return false, fmt.Errorf("failed to build endorsement message: %w", err)
}

// 2. Восстанавливаем endorser PK по индексам
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh no! Please use English only.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

return nil
}

func (a *txAppender) isLastBlockFinalized(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Strange naming, is it better to name the function "updateFinalization" or "calculateFinalization"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

if err != nil {
return false, err
}
msg, err := proto.EndorsementMessage(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why construct an endorsement message here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, I see, it's for block header validation. I'd rather move this function to proto package, somewhere near block declaration or even made it a part of Block type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Which file are you suggesting to move it to?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because this function EndorsementMessage is already in proto

Copy link
Collaborator

Choose a reason for hiding this comment

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

Corresponding `pkg/client' parts have to be implemented.

@esuwu
Copy link
Contributor Author

esuwu commented Dec 3, 2025

Moved storage to add-network-messages

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.

3 participants