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

rework transaction EffectHash #2943

Merged
merged 7 commits into from
Aug 21, 2023
Merged

rework transaction EffectHash #2943

merged 7 commits into from
Aug 21, 2023

Conversation

redshiftzero
Copy link
Contributor

@redshiftzero redshiftzero commented Aug 16, 2023

Closes #2808
Adds a section of documentation on transaction signing which describe the changes made in this PR

@redshiftzero redshiftzero temporarily deployed to smoke-test August 16, 2023 21:32 — with GitHub Actions Inactive
@redshiftzero redshiftzero changed the title rework transaction EffectHash wip: rework transaction EffectHash Aug 17, 2023
@redshiftzero redshiftzero temporarily deployed to smoke-test August 18, 2023 19:22 — with GitHub Actions Inactive
@redshiftzero redshiftzero temporarily deployed to smoke-test August 18, 2023 20:45 — with GitHub Actions Inactive
@redshiftzero redshiftzero temporarily deployed to smoke-test August 18, 2023 21:15 — with GitHub Actions Inactive
@redshiftzero redshiftzero changed the title wip: rework transaction EffectHash rework transaction EffectHash Aug 18, 2023
@redshiftzero redshiftzero marked this pull request as ready for review August 20, 2023 23:51
@redshiftzero
Copy link
Contributor Author

redshiftzero commented Aug 20, 2023

CI is failing here due to unrelated proto changes (proto linting job is failing), (nvm, this was fixed after rebasing on main) but this is ready for review

Base automatically changed from 2000-proto-effect-hash to main August 20, 2023 23:51
@redshiftzero redshiftzero temporarily deployed to smoke-test August 20, 2023 23:53 — with GitHub Actions Inactive
Comment on lines +43 to +44
effect_hash = BLAKE2b-512(len(type_url) || type_url || proto_encode(proto))
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Might want to specify how the length is encoded

Copy link
Contributor

@cronokirby cronokirby left a comment

Choose a reason for hiding this comment

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

Looks all fine and dandy

Comment on lines 59 to 64
let personalization = TransactionBody::TYPE_URL;

let mut state = blake2b_simd::State::new();
let length = personalization.len() as u64;
state.update(&length.to_le_bytes());
state.update(personalization.as_bytes());
Copy link
Member

Choose a reason for hiding this comment

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

Can we factor this into a common method?

Copy link
Member

Choose a reason for hiding this comment

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

Aesthetically I think it'd be nice if this used a u16 length for compactness but I'm not sure that that's actually a good idea. Probably best to not have to worry about the length.

Copy link
Member

Choose a reason for hiding this comment

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

(Probably not important to block merging on this)

@redshiftzero redshiftzero temporarily deployed to smoke-test August 21, 2023 17:23 — with GitHub Actions Inactive
@redshiftzero redshiftzero merged commit 6ca614d into main Aug 21, 2023
@redshiftzero redshiftzero deleted the effect-hash-part-2 branch August 21, 2023 17:43
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.

Rework EffectHash
3 participants