Skip to content

CHIA-255: implement CHIP-34#403

Closed
arvidn wants to merge 6 commits intomainfrom
chip-34
Closed

CHIA-255: implement CHIP-34#403
arvidn wants to merge 6 commits intomainfrom
chip-34

Conversation

@arvidn
Copy link
Copy Markdown
Contributor

@arvidn arvidn commented May 10, 2024

this PR is best reviewed one commit at a time.

It implements CHIP-34.

new operators

There are 3 new operators enabled under softfork 1:

operator opcode
base64url_encode 62
base64url_decode 63
keccak256 64

cost

operator base cost per argument per byte
base64url_encode 40 130 2
base64url_decode 400 - 2
keccak256 50 160 2

As always, there's also a cost of 10 per byte that's allocated for the return value.

activation

Since this is a softfork, the extension will only be available when the ENABLE_BASE64 flag is set, which it will be after the softfork activates.

The operators will only be available for programs (<prg>) executing under (softfork <cost> 1 <prg> <arg>)

hard fork

There's an option to hard-fork these operators out of the softfork-guard by specifying ENABLE_BASE64_OPS_OUTSIDE_GUARD.

keccak-256

The test vectors are generated using the python wheel from eth_hash.auto import keccak.

@coveralls-official
Copy link
Copy Markdown

coveralls-official bot commented May 10, 2024

Pull Request Test Coverage Report for Build 9096480917

Details

  • 90 of 92 (97.83%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 94.214%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/base64_ops.rs 61 62 98.39%
src/chia_dialect.rs 7 8 87.5%
Totals Coverage Status
Change from base Build 9096453504: 0.05%
Covered Lines: 5895
Relevant Lines: 6257

💛 - Coveralls

@arvidn arvidn force-pushed the chip-34 branch 3 times, most recently from 4a7deff to e76160c Compare May 13, 2024 15:01
@arvidn arvidn marked this pull request as ready for review May 15, 2024 13:43
@arvidn arvidn requested a review from Rigidity May 15, 2024 13:43
Copy link
Copy Markdown
Contributor

@Rigidity Rigidity left a comment

Choose a reason for hiding this comment

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

Looks good to me (feel free to resolve these minor comments)

@arvidn
Copy link
Copy Markdown
Contributor Author

arvidn commented Jul 8, 2024

these features were cancelled.

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