Skip to content

[5.0 -> main] Benchmark BLS host functions, Do not require trailing = for base64 encoded strings#1898

Merged
heifner merged 20 commits into
mainfrom
GH-1461-base64-main
Nov 14, 2023
Merged

[5.0 -> main] Benchmark BLS host functions, Do not require trailing = for base64 encoded strings#1898
heifner merged 20 commits into
mainfrom
GH-1461-base64-main

Conversation

@heifner

@heifner heifner commented Nov 14, 2023

Copy link
Copy Markdown
Contributor

Merging release/5.0 into main including #1889 & #1892 (all empty commits superseded by #1888) and #1884.

========================
Add benchmarking of BLS host functions into Leap Benchmark suites. Those host functions are directly benchmarked without using CDT wrappers.

Use benchmark/benchmark -f bls to benchmark. A sample result looks like

function                    runs        average       minimum       maximum

bls:
bls_g1_add                  1,000       2,736 ns       2,607 ns      10,048 ns
bls_g2_add                  1,000       6,766 ns       6,461 ns      13,983 ns
bls_g1_mul                  1,000     193,676 ns     191,533 ns     204,904 ns
bls_g2_mul                  1,000     486,744 ns     480,722 ns     516,755 ns
bls_pairing 1 pair          1,000   1,284,147 ns   1,263,355 ns   1,521,806 ns
bls_pairing 3 pairs         1,000   2,095,239 ns   2,060,983 ns   2,448,659 ns
bls_g1_exp 1 point          1,000     491,239 ns     485,616 ns     626,591 ns
bls_g1_exp 3 points         1,000     698,879 ns     692,786 ns     741,049 ns
bls_g2_exp 1 point          1,000   1,239,919 ns   1,229,475 ns   1,559,680 ns
bls_g2_exp 3 points         1,000   1,841,482 ns   1,821,692 ns   2,167,092 ns
bls_g1_map                  1,000     297,041 ns     291,710 ns     310,379 ns
bls_g2_map                  1,000     380,135 ns     374,088 ns     438,751 ns
bls_fp_mod                  1,000         764 ns         668 ns       7,571 ns

Resolves #1854

========================
These changes superseded by #1888.

All previous versions of nodeos required a trailing = for base64 encoded strings. fc::variant appends an extra = for all of its base64 encoded strings. However, non-fc base64 encoders do not add an extra = when one is not needed. This PR modifies fc::variant to support non-fc base64 encoded strings that do not have the extra =.

In 5.0, fc::variant was updated to not add the extra = to base64 encoded strings. See #1888. This PR allows nodeos to support the new 5.0 version of base64 encoded strings.

Empty diff because changes already part of #1888

Issue #1461

linh2931 and others added 20 commits November 9, 2023 10:21
[3.2] Do not require trailing `=` for base64 encoded strings
[3.2 -> 4.0] Do not require trailing `=` for base64 encoded strings
[4.0 -> 5.0] Do not require trailing = for base64 encoded strings
@heifner heifner requested review from greg7mdp and linh2931 November 14, 2023 13:36
@heifner heifner added the OCI Work exclusive to OCI team label Nov 14, 2023

@linh2931 linh2931 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @heifner for merging the benchmarking PR together for me.

@heifner heifner requested a review from spoonincode November 14, 2023 21:11
@heifner heifner merged commit 5d665bb into main Nov 14, 2023
@heifner heifner deleted the GH-1461-base64-main branch November 14, 2023 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCI Work exclusive to OCI team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Benchmark for leap BLS Host Functions

4 participants