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

feat: implement precompile contract for opBNB #6

Merged
merged 18 commits into from
May 21, 2024
Merged

Conversation

j75689
Copy link
Collaborator

@j75689 j75689 commented Apr 11, 2024

Description

implement precompile contract to support opBNB Fermat Fork.

included:

  1. BLS signature verification - bls.rs
  2. CometBft light block verification - cometbft.rs

The opBNB function will only be compiled when the "opbnb" feature is enabled.

Related

bnb-chain/greenfield-cometbft-rs#1

@j75689 j75689 force-pushed the feat/v34-opbnb branch 2 times, most recently from 6a05463 to 5cdc813 Compare April 12, 2024 01:34
Copy link
Contributor

github-actions bot commented Apr 12, 2024

Valgrind Results:

==5089== Cachegrind, a cache and branch-prediction profiler
==5089== Copyright (C) 2002-2017, and GNU GPL'd, by Nicholas Nethercote et al.
==5089== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==5089== Command: target/release/snailtracer
==5089== 
--5089-- warning: L3 cache found, using its data for the LL simulation.
==5089== brk segment overflow in thread #1: can't grow to 0x4cb4000
==5089== (see section Limitations in user manual)
==5089== NOTE: further instances of this message will not be shown
Snailtracer Host+Interpreter benchmark (5.6s) ... 1_749_925_538.000 ns/iter (1.000 R²)
==5089== 
==5089== I   refs:      1,348,416,891
==5089== I1  misses:            7,702
==5089== LLi misses:            3,059
==5089== I1  miss rate:          0.00%
==5089== LLi miss rate:          0.00%
==5089== 
==5089== D   refs:        677,296,446  (452,038,812 rd   + 225,257,634 wr)
==5089== D1  misses:        1,226,167  (    684,559 rd   +     541,608 wr)
==5089== LLd misses:          201,145  (      4,158 rd   +     196,987 wr)
==5089== D1  miss rate:           0.2% (        0.2%     +         0.2%  )
==5089== LLd miss rate:           0.0% (        0.0%     +         0.1%  )
==5089== 
==5089== LL refs:           1,233,869  (    692,261 rd   +     541,608 wr)
==5089== LL misses:           204,204  (      7,217 rd   +     196,987 wr)
==5089== LL miss rate:            0.0% (        0.0%     +         0.1%  )

@j75689 j75689 force-pushed the feat/v34-opbnb branch 4 times, most recently from 7f9beee to cd58162 Compare April 29, 2024 11:39
@j75689 j75689 marked this pull request as ready for review May 5, 2024 23:47
Copy link
Collaborator

@unclezoro unclezoro left a comment

Choose a reason for hiding this comment

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

we need for the cometbft repo.

@keefel keefel merged commit f5cc71d into develop May 21, 2024
22 of 24 checks passed
j75689 added a commit that referenced this pull request Jun 3, 2024
* feat: implement precompile contract for opBNB

* fix: unused import warning in test

* ci: add develop branch to the list of branches to run

* chore: fmt codes

* chore: fix no default feature importing

* chore: cargo clippy fix

* ci: disable checks on riscv32imac-unknown-none-elf

* chore: setup vec with capacity

* fix: cometbft_light_block_validate input conversion

* chore: fix fmt

* fix: add opbnb feature to ECOTONE

* fix: sepc definition

* chore: fix opBNB feature tags

* chore(ci): bump action/deploy (#1372)

* fix: light block header validation in cometbft

* chore: fix fmt

* fix: BLS_SIGNATURE_VALIDATION_BASE to 1000

* update greenfield-cometbft-rs version

---------

Co-authored-by: rakita <rakita@users.noreply.github.com>
Co-authored-by: Keefe Liu <keefe.l@users.noreply.github.com>
j75689 added a commit that referenced this pull request Jun 3, 2024
* feat: implement precompile contract for opBNB

* fix: unused import warning in test

* ci: add develop branch to the list of branches to run

* chore: fmt codes

* chore: fix no default feature importing

* chore: cargo clippy fix

* ci: disable checks on riscv32imac-unknown-none-elf

* chore: setup vec with capacity

* fix: cometbft_light_block_validate input conversion

* chore: fix fmt

* fix: add opbnb feature to ECOTONE

* fix: sepc definition

* chore: fix opBNB feature tags

* chore(ci): bump action/deploy (#1372)

* fix: light block header validation in cometbft

* chore: fix fmt

* fix: BLS_SIGNATURE_VALIDATION_BASE to 1000

* update greenfield-cometbft-rs version

---------

Co-authored-by: rakita <rakita@users.noreply.github.com>
Co-authored-by: Keefe Liu <keefe.l@users.noreply.github.com>
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.

4 participants