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

Make MultiKeyAuthenicator work #34

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Make MultiKeyAuthenicator work #34

wants to merge 1 commit into from

Conversation

davidiw
Copy link
Contributor

@davidiw davidiw commented Sep 30, 2024

The code was written but never tested... and there was an example test that wasn't being tested either....

Copy link
Contributor

@gregnazario gregnazario left a comment

Choose a reason for hiding this comment

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

I think there's some implementation details here that don't match the rust code

BITMAP_NUM_OF_BYTES: int = 4
MAX_SIGNATURES: int = 16
Copy link
Contributor

Choose a reason for hiding this comment

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

I couldn't find this 16 signature limit? Is this just for the SDK?

As far as I can tell, the limit is 255

https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L794-L798

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L811

distinct keys is 16... I think we kinda messed up here, but I think we can make this bigger without any impact since we use the bitvec.

Comment on lines +213 to +214
count = 1 if bitmap < 256 else 2
serializer.to_bytes(bitmap.to_bytes(count, "little"))
Copy link
Contributor

Choose a reason for hiding this comment

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

The signature limit accepted on the other side only goes up to 255? https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L794-L798

Is there a reason it's doing custom byte sequence serialization? I noticed this is really not simple to do in the Python SDK

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is how the bitvec works...
length + data

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.

2 participants