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

[CT-1198] Add smart account and circuit break ante handler #2325

Merged
merged 6 commits into from
Sep 25, 2024
Merged

Conversation

jayy04
Copy link
Contributor

@jayy04 jayy04 commented Sep 23, 2024

Changelist

[Describe or list the changes made in this PR]

Test Plan

[Describe how this PR was tested (if applicable)]

Author/Reviewer Checklist

  • If this PR has changes that result in a different app state given the same prior state and transaction list, manually add the state-breaking label.
  • If the PR has breaking postgres changes to the indexer add the indexer-postgres-breaking label.
  • If this PR isn't state-breaking but has changes that modify behavior in PrepareProposal or ProcessProposal, manually add the label proposal-breaking.
  • If this PR is one of many that implement a specific feature, manually label them all feature:[feature-name].
  • If you wish to for mergify-bot to automatically create a PR to backport your change to a release branch, manually add the label backport/[branch-name].
  • Manually add any of the following labels: refactor, chore, bug.

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced new metric constants for enhanced monitoring of the authenticator system.
    • Added the AuthenticatorDecorator to manage authentication logic during transaction processing.
    • Implemented the CircuitBreakerDecorator for dynamic transaction routing based on circuit breaker status.
    • Added functionality to check for selected authenticator extensions in transactions.
    • Enhanced codec capabilities with a new interface for handling authenticator transaction options.
  • Bug Fixes

    • Added specific error handling for inactive smart accounts.
  • Tests

    • Established comprehensive test suites for both AuthenticatorDecorator and CircuitBreakerDecorator, ensuring robust functionality and error handling.
  • Documentation

    • Updated error handling documentation to include new error variables and interfaces.

@jayy04 jayy04 requested a review from a team as a code owner September 23, 2024 20:04
Copy link

linear bot commented Sep 23, 2024

Copy link
Contributor

coderabbitai bot commented Sep 23, 2024

Walkthrough

The changes introduce several new components and functionalities to the authentication system within the protocol. Key additions include new constants for tracking authenticator metrics, the implementation of the AuthenticatorDecorator for transaction processing, and the CircuitBreakerDecorator for managing transaction routing. Additionally, new methods in the Keeper struct enhance authenticator management, while comprehensive test suites ensure the reliability of these new features.

Changes

File Path Change Summary
protocol/lib/metrics/metric_keys.go Added constants for tracking authenticator metrics: AuthenticatorDecoratorAnteHandleLatency, MissingRegisteredAuthenticator, and AuthenticatorTrackFailed.
protocol/x/accountplus/ante/ante.go Introduced AuthenticatorDecorator for processing authentication logic in transactions, including methods for validation and handling ante logic.
protocol/x/accountplus/ante/ante_test.go Created a test suite for AuthenticatorDecorator, covering scenarios for signature verification with and without authenticators, and fee payer gas consumption.
protocol/x/accountplus/ante/circuit_breaker.go Added CircuitBreakerDecorator for dynamic transaction routing based on circuit breaker status, including methods for handling ante logic.
protocol/x/accountplus/ante/circuit_breaker_test.go Established a test suite for CircuitBreakerDecorator, verifying behavior under different transaction conditions.
protocol/x/accountplus/keeper/authenticators.go Enhanced the Keeper struct with methods for retrieving and initializing authenticators, and handling transaction extensions.
protocol/x/accountplus/types/codec.go Added AuthenticatorTxOptions interface and updated registration functions to handle authenticator transaction options.
protocol/x/accountplus/types/errors.go Introduced ErrSmartAccountNotActive error variable for improved error handling related to smart account status.

Possibly related PRs

Suggested labels

feature:timestamp_nonce

Suggested reviewers

  • roy-dydx
  • vincentwschau

🐰 In the meadow, changes bloom bright,
New metrics and decorators take flight.
With tests to ensure all flows are right,
The authenticator's dance is a delightful sight!
Hopping through code, we celebrate this night! 🌙


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 43c09ff and a260fd6.

📒 Files selected for processing (2)
  • protocol/x/accountplus/ante/ante.go (1 hunks)
  • protocol/x/accountplus/ante/circuit_breaker.go (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • protocol/x/accountplus/ante/ante.go
  • protocol/x/accountplus/ante/circuit_breaker.go

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 18

Outside diff range and nitpick comments (13)
protocol/x/accountplus/types/errors.go (1)

21-25: LGTM! Consider a minor improvement to the error message.

The new error ErrSmartAccountNotActive is well-defined and consistent with the existing error structure. The error code (4) correctly follows the sequence of existing error codes.

Consider slightly modifying the error message for improved clarity:

-		"Smart account is not active",
+		"Smart account is not active or not properly initialized",

This change provides more context about potential reasons for the error, which could be helpful for debugging.

protocol/x/accountplus/types/codec.go (1)

10-13: LGTM: New interface looks good, but needs documentation.

The AuthenticatorTxOptions interface is well-defined and aligns with the PR objectives. However, it would be beneficial to add documentation comments explaining the purpose of this interface and its method.

Consider adding documentation comments like this:

// AuthenticatorTxOptions defines the interface for transaction options related to authenticators.
type AuthenticatorTxOptions interface {
    // GetSelectedAuthenticators returns a slice of authenticator IDs that are selected for the transaction.
    GetSelectedAuthenticators() []uint64
}
protocol/x/accountplus/lib/lib.go (1)

10-15: LGTM: Function signature is well-defined. Consider enhancing documentation.

The function signature is clear and appropriate. However, to improve maintainability and usability, consider adding a more detailed godoc comment that includes:

  • A brief description of each parameter
  • An explanation of the return values
  • Any potential error cases or side effects

Here's a suggested enhancement for the documentation:

// HasSelectedAuthenticatorTxExtensionSpecified checks if the transaction has the correct
// extension for the authenticator flow.
//
// Parameters:
//   - tx: The transaction to check
//   - accountPlusKeeper: The keeper for accessing account-related data
//
// Returns:
//   - bool: true if the transaction has the correct extension, false otherwise
//   - types.AuthenticatorTxOptions: The authenticator options if present, nil otherwise
//
// Note: This function returns false to indicate that the authenticator flow should continue.
protocol/lib/metrics/metric_keys.go (1)

92-96: Enhance clarity and consistency of new authenticator metrics

The new constants for authenticator metrics are a good addition and align with the PR objectives. However, there are a few suggestions for improvement:

  1. The comment "Account plus" could be more descriptive. Consider changing it to "Authenticator metrics" or "Smart account metrics" for clarity.

  2. For consistency with the guidelines mentioned at the top of the file, consider adding a unit suffix to the AuthenticatorDecoratorAnteHandleLatency constant. For example:

    AuthenticatorDecoratorAnteHandleLatencyMs = "authenticator_decorator_ante_handle_latency_ms"
  3. To provide more context, you might want to add brief comments explaining the purpose of each new metric, especially for MissingRegisteredAuthenticator and AuthenticatorTrackFailed.

Here's a suggested revision:

// Authenticator metrics
AuthenticatorDecoratorAnteHandleLatencyMs = "authenticator_decorator_ante_handle_latency_ms"
MissingRegisteredAuthenticator            = "missing_registered_authenticator"
AuthenticatorTrackFailed                  = "authenticator_track_failed"

Consider adding brief comments above each constant to explain their specific purposes.

protocol/x/accountplus/ante/circuit_breaker_test.go (3)

77-77: Correct the application name in the comment

The comment mentions "Initialize the Osmosis application," which seems out of context for this codebase. Update the comment to accurately reflect the application being initialized.

Apply this diff to correct the comment:

-// Initialize the Osmosis application
+// Initialize the test application

174-174: Fix grammatical error in comment

The comment should read "there is no selected authenticator" instead of "there is not selected authenticator".

Apply this diff to correct the grammar:

-// Here we test when smart accounts are active and there is not selected authenticator
+// Here we test when smart accounts are active and there is no selected authenticator

190-190: Correct the comment for clarity

The comment has a minor grammatical error. It should read "Test if smart accounts are active and the authenticator flow is selected".

Apply this diff to improve the comment:

-// Test is smart accounts are active and the authenticator flow is selected
+// Test if smart accounts are active and the authenticator flow is selected
protocol/x/accountplus/keeper/authenticators.go (2)

116-117: Improve clarity and fix grammatical error in comment.

The comment on line 116 has a grammatical error and could be rephrased for better clarity. It currently reads:

// GetAuthenticatorExtension unpacks the extension for the transaction, this is used with transactions specify
// an authenticator to use

Consider revising it as:

-// GetAuthenticatorExtension unpacks the extension for the transaction, this is used with transactions specify
-// an authenticator to use
+// GetAuthenticatorExtension unpacks the transaction extensions to find an AuthenticatorTxOptions.
+// This is used with transactions that specify an authenticator to use.

174-174: Correct typo in log message for professionalism.

There's a typo in the log message on line 174. The word "asscoicated" should be "associated".

-    "account asscoicated authenticator not registered in manager",
+    "account associated authenticator not registered in manager",
protocol/x/accountplus/ante/ante_test.go (4)

70-82: Initialization of Slice Fields Before Appending

The slices s.TestPrivKeys and s.TestAccAddress are being appended to without prior initialization, which is acceptable but may reduce code readability.

Consider initializing the slices explicitly before appending:

 // Set up test accounts
-accounts := make([]sdk.AccountI, 0)
+accounts := []sdk.AccountI{}
+s.TestPrivKeys = []*secp256k1.PrivKey{}
+s.TestAccAddress = []sdk.AccAddress{}
 for _, key := range s.TestKeys {

108-110: Unnecessary Use of HomeDir and Cleanup in TearDownTest

The HomeDir field is assigned but not utilized elsewhere in the code. Additionally, os.RemoveAll(s.HomeDir) may not be necessary.

If HomeDir is not required, consider removing it and the associated cleanup:

-type AuthenticatorAnteSuite struct {
-	// ...
-	HomeDir string
-}
+type AuthenticatorAnteSuite struct {
+	// ...
+}

 func (s *AuthenticatorAnteSuite) TearDownTest() {
-	os.RemoveAll(s.HomeDir)
+	// No cleanup necessary
 }

232-233: Typographical Error in Method Name TestFeePayerGasComsumption

The method name TestFeePayerGasComsumption contains a typo: "Comsumption" should be "Consumption".

Correct the method name for clarity:

-func (s *AuthenticatorAnteSuite) TestFeePayerGasComsumption() {
+func (s *AuthenticatorAnteSuite) TestFeePayerGasConsumption() {

295-380: Redundant name Field in Test Cases of TestSpecificAuthenticator

The name field inside each test case is not utilized since the test name is derived from the map keys.

Remove the unnecessary name field to simplify the test cases:

 testCases := map[string]struct {
-	name                  string
 	senderKey             cryptotypes.PrivKey
 	// ...
 }{
-	"Correct authenticator 0": {
-		name: "Correct authenticator 0",
+	"Correct authenticator 0": {
 		senderKey:             s.TestPrivKeys[0],
 		// ...
 	},
 	// Other test cases...
 }
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ebf8fe4 and 6717cfa.

Files selected for processing (9)
  • protocol/lib/metrics/metric_keys.go (1 hunks)
  • protocol/x/accountplus/ante/ante.go (1 hunks)
  • protocol/x/accountplus/ante/ante_test.go (1 hunks)
  • protocol/x/accountplus/ante/circuit_breaker.go (1 hunks)
  • protocol/x/accountplus/ante/circuit_breaker_test.go (1 hunks)
  • protocol/x/accountplus/keeper/authenticators.go (2 hunks)
  • protocol/x/accountplus/lib/lib.go (1 hunks)
  • protocol/x/accountplus/types/codec.go (1 hunks)
  • protocol/x/accountplus/types/errors.go (1 hunks)
Additional comments not posted (6)
protocol/x/accountplus/types/codec.go (3)

6-7: LGTM: New imports are appropriate for the changes.

The added imports for msgservice and tx from the Cosmos SDK are necessary and correctly used in the subsequent code changes.


24-24: LGTM: Message service descriptor registration added.

The addition of msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) is correct and follows Cosmos SDK module practices. However, we should verify the existence and correct definition of _Msg_serviceDesc.

Please run the following script to verify the _Msg_serviceDesc variable:

#!/bin/bash
# Description: Verify the existence and correct definition of _Msg_serviceDesc

# Test 1: Search for the definition of _Msg_serviceDesc
echo "Searching for _Msg_serviceDesc definition:"
rg --type go "_Msg_serviceDesc\s*=\s*"

# Test 2: Check if _Msg_serviceDesc is of the correct type
echo "Checking _Msg_serviceDesc type:"
ast-grep --lang go --pattern 'var _Msg_serviceDesc = $$$grpc.ServiceDesc$$$'

18-23: LGTM: Interface registrations look correct, but need verification.

The registrations for tx.TxExtensionOptionI and AuthenticatorTxOptions are correctly implemented. However, we should verify that the TxExtension struct properly implements both interfaces.

Please run the following script to verify the TxExtension struct implementation:

protocol/x/accountplus/lib/lib.go (1)

3-8: LGTM: Imports are appropriate and concise.

The imported packages are relevant to the function's purpose, including SDK types, auth ante, and local project packages.

protocol/x/accountplus/ante/circuit_breaker_test.go (1)

106-115: Consider invoking the next AnteHandler in MockAnteDecorator

In the AnteHandle method of MockAnteDecorator, the next AnteHandler is not called. Typically, an AnteDecorator should invoke the next handler to ensure the entire chain executes properly. If skipping next is intentional for this test, please ensure that it's documented.

If it's appropriate to call next, apply this diff:

 func (m MockAnteDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler,
 ) (newCtx sdk.Context, err error) {
 	prio := ctx.Priority()

 	if m.Called == 1 {
-		return ctx.WithPriority(prio + 1), nil
+		ctx = ctx.WithPriority(prio + 1)
 	} else {
-		return ctx.WithPriority(prio + 2), nil
+		ctx = ctx.WithPriority(prio + 2)
 	}
+	return next(ctx, tx, simulate)
 }
protocol/x/accountplus/ante/ante_test.go (1)

382-412: Potential Misalignment Between Test Case Descriptions and Assertions

Ensure that each test case in TestSpecificAuthenticator clearly reflects its purpose and that assertions align with the expected outcomes.

Review the test cases to confirm they accurately test the specified scenarios and adjust descriptions if necessary.

protocol/x/accountplus/lib/lib.go Outdated Show resolved Hide resolved
protocol/x/accountplus/ante/circuit_breaker.go Outdated Show resolved Hide resolved
protocol/x/accountplus/ante/circuit_breaker.go Outdated Show resolved Hide resolved
protocol/x/accountplus/ante/ante_test.go Outdated Show resolved Hide resolved
Comment on lines +54 to +62
func (s *AuthenticatorAnteSuite) SetupTest() {
// Test data for authenticator signature verification
TestKeys := []string{
"6cf5103c60c939a5f38e383b52239c5296c968579eec1c68a47d70fbf1d19159",
"0dd4d1506e18a5712080708c338eb51ecf2afdceae01e8162e890b126ac190fe",
"49006a359803f0602a7ec521df88bf5527579da79112bb71f285dd3e7d438033",
}

s.HomeDir = fmt.Sprintf("%d", rand.Int())
Copy link
Contributor

Choose a reason for hiding this comment

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

Variable Shadowing of TestKeys in SetupTest

The local variable TestKeys declared on line 56 shadows the TestKeys field of the AuthenticatorAnteSuite struct. This could lead to confusion or unintended behavior.

Consider renaming the local variable or assigning the keys directly to s.TestKeys:

-func (s *AuthenticatorAnteSuite) SetupTest() {
-	// Test data for authenticator signature verification
-	TestKeys := []string{
+func (s *AuthenticatorAnteSuite) SetupTest() {
+	// Test data for authenticator signature verification
+	s.TestKeys = []string{
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func (s *AuthenticatorAnteSuite) SetupTest() {
// Test data for authenticator signature verification
TestKeys := []string{
"6cf5103c60c939a5f38e383b52239c5296c968579eec1c68a47d70fbf1d19159",
"0dd4d1506e18a5712080708c338eb51ecf2afdceae01e8162e890b126ac190fe",
"49006a359803f0602a7ec521df88bf5527579da79112bb71f285dd3e7d438033",
}
s.HomeDir = fmt.Sprintf("%d", rand.Int())
func (s *AuthenticatorAnteSuite) SetupTest() {
// Test data for authenticator signature verification
s.TestKeys = []string{
"6cf5103c60c939a5f38e383b52239c5296c968579eec1c68a47d70fbf1d19159",
"0dd4d1506e18a5712080708c338eb51ecf2afdceae01e8162e890b126ac190fe",
"49006a359803f0602a7ec521df88bf5527579da79112bb71f285dd3e7d438033",
}
s.HomeDir = fmt.Sprintf("%d", rand.Int())

protocol/x/accountplus/ante/ante_test.go Outdated Show resolved Hide resolved
protocol/x/accountplus/ante/ante_test.go Outdated Show resolved Hide resolved
protocol/x/accountplus/ante/ante_test.go Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 091e935 and 511f271.

<details>
Files selected for processing (3)
  • protocol/x/accountplus/ante/circuit_breaker.go (1 hunks)
  • protocol/x/accountplus/ante/circuit_breaker_test.go (1 hunks)
  • protocol/x/accountplus/lib/lib.go (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • protocol/x/accountplus/ante/circuit_breaker.go
  • protocol/x/accountplus/ante/circuit_breaker_test.go
Additional comments not posted (2)
protocol/x/accountplus/lib/lib.go (2)

3-9: LGTM: Import statements are appropriate and concise.

The import statements are well-organized and include all necessary packages for the implemented functionality. There are no unused imports.


1-43: Overall assessment: Good implementation with room for minor improvements.

The new lib.go file introduces two well-structured functions that correctly implement the logic for handling authenticator extensions in transactions. The code is generally well-written and follows good practices.

Key points:

  1. Both functions, HasSelectedAuthenticatorTxExtensionSpecified and GetAuthenticatorExtension, are logically sound and serve their intended purposes.
  2. The suggested improvements focus on enhancing error logging and adding inline comments, which will improve the code's maintainability and debuggability.
  3. Once these minor enhancements are implemented, the code will be more robust and easier to maintain.

Great job on the implementation! Please consider the suggested improvements to further enhance the code quality.

protocol/x/accountplus/lib/lib.go Show resolved Hide resolved
protocol/x/accountplus/lib/lib.go Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range and nitpick comments (1)
protocol/x/accountplus/ante/ante.go (1)

48-230: Consider refactoring AnteHandle for improved readability

The AnteHandle method is quite long and complex. Consider breaking it down into smaller, well-named helper functions to improve readability and maintainability. This would make the overall flow easier to understand and test.

LGTM: Consistent error handling

The error handling in this method is now consistent, addressing a previous review comment. Good job on maintaining consistency in returning the context with errors.

Verification: Osmosis reference removed

The comment referring to Osmosis has been removed as suggested in a previous review, improving the clarity and relevance of the documentation.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b713948 and 43c09ff.

Files selected for processing (6)
  • protocol/x/accountplus/ante/ante.go (1 hunks)
  • protocol/x/accountplus/ante/ante_test.go (1 hunks)
  • protocol/x/accountplus/ante/circuit_breaker.go (1 hunks)
  • protocol/x/accountplus/ante/circuit_breaker_test.go (1 hunks)
  • protocol/x/accountplus/authenticator/signature_authenticator.go (0 hunks)
  • protocol/x/accountplus/keeper/authenticators.go (2 hunks)
Files not reviewed due to no reviewable changes (1)
  • protocol/x/accountplus/authenticator/signature_authenticator.go
Files skipped from review as they are similar to previous changes (4)
  • protocol/x/accountplus/ante/ante_test.go
  • protocol/x/accountplus/ante/circuit_breaker.go
  • protocol/x/accountplus/ante/circuit_breaker_test.go
  • protocol/x/accountplus/keeper/authenticators.go
Additional comments not posted (4)
protocol/x/accountplus/ante/ante.go (4)

1-31: LGTM: Package declaration, imports, and struct definition

The package declaration, imports, and AuthenticatorDecorator struct definition look appropriate for the intended functionality.


33-46: LGTM: NewAuthenticatorDecorator function

The NewAuthenticatorDecorator function correctly initializes and returns a new instance of AuthenticatorDecorator with all necessary fields.


232-262: LGTM: ValidateAuthenticatorFeePayer method

The ValidateAuthenticatorFeePayer method correctly enforces that the transaction fee payer is not manually set and is the first signer of the transaction. The error messages are clear and informative.


264-299: LGTM: GetSelectedAuthenticators method

The GetSelectedAuthenticators method correctly retrieves the selected authenticators from the transaction extension and ensures that their number matches the number of messages. The error handling is appropriate, with clear and informative error messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants