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

SYS-3560 - Minor refactor before benchmarking #405

Merged

Conversation

nahuseyoum
Copy link
Contributor

This PR introduces a minor refactor prior to running benchmarks:

  • Replace hardcoded value with storage
  • Consolidate a few iterations into one
  • Simplify operations (such as sorting) to be done on primitive types instead of objects

ivan-cholakov and others added 19 commits May 3, 2024 14:48
Introduces the data structures and the voting mechanism for accepting
events ranges from ethereum.

Ranges that are too big will be broken down into smaller partitions,
voted upon individually, and accepted as one.

Follow up commit will do the validate unsigned and processing of the
partitions.

Jira tickets:
- SYS-3635
- SYS-3930
Updates the validate unsigned function to support
submit_discovered_events extrinsic.

Jira tickets:
- SYS-3635
- SYS-3930
This PR introduces support for processing votes upon achieving consensus. It extends extrinsics and data structures accordingly.

Once the final vote is cast, the voting round for the Ethereum range partition is finalized, and the partition is processed.

Additionally, this PR extends the subscription mechanism of the eth-bridge pallet. By default, pallets ignore processed events, requiring the implementation of a handler to process them.
Benchmarking for certain actions will be addressed in a separate PR.

Jira Tasks:
- SYS-3930
- SYS-3635
Signed-off-by: Ivan Cholakov <icholakov1@gmail.com>
Co-authored-by: Thanos Doukoudakis <56822898+thadouk@users.noreply.github.com>
Signed-off-by: Ivan Cholakov <icholakov1@gmail.com>
Co-authored-by: Thanos Doukoudakis <56822898+thadouk@users.noreply.github.com>
Adds a new endpoint that allows the chain to reach consenus over the initial ethereum range to be used.
This allows to simplify the voting logic for active ranges, eliminating the special case of the first range.

Jira ticket:
- SYS-3930
Extends the runtime API for initial range consensus mechanism

Jira task
- SYS-3930
Adds basic unit tests that check the submit_ethereum_events interface

Jira task:
- SYS-3930
- SYS-3635
- General cleanup
- Rename of storage items
- Removal of mocks
- Wire up with runtime, implementing different events filters for each runtime.
…397)

This commit includes the integration of the initial range voting functionality with the client.
It ports changes to integrate the runtime API for testing runtime behavior.
Additionally, it refactors the runtime API to improve proof creation by relocating helper
functions to primitive crates.
Fixes genesis config for test runtime.

Jira tasks:
- SYS-3930
- SYS-3635
This commit addresses issues with extrinsic submission in the runtime:

- Registers the extension to the instance submitting the extrinsic.
- Updates signature validation.
- Simplifies interface and error handling via the runtime API, following the report_equivocation style.
…o eth-bridge (#390)

Co-authored-by: Thanos <56822898+thadouk@users.noreply.github.com>
Co-authored-by: nahuseyoum <nahu.seyoum@aventus.io>
…-Network-Services/avn-parachain into nahu-sys3560-ethBridge-refactor
@nahuseyoum nahuseyoum changed the title Nahu sys3560 eth bridge refactor SYS-3560 - Minor refactor before benchmarking May 23, 2024
.map(|(range, votes)| (range, votes.len()))
.collect();
sorted_votes.sort_by(|(range_a, _votes_a), (range_b, _votes_b)| range_a.cmp(range_b));
submitted_blocks.sort();
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@nahuseyoum nahuseyoum merged commit 8a1201e into feat/SYS-3560-add-event-listener May 31, 2024
@nahuseyoum nahuseyoum deleted the nahu-sys3560-ethBridge-refactor branch May 31, 2024 08:39
thadouk added a commit that referenced this pull request Jun 5, 2024
Signed-off-by: Ivan Cholakov <icholakov1@gmail.com>
Co-authored-by: Ivan Cholakov <icholakov1@gmail.com>
Co-authored-by: Thanos <56822898+thadouk@users.noreply.github.com>
Co-authored-by: Michael <62653655+MBrozhko34@users.noreply.github.com>
thadouk added a commit that referenced this pull request Jun 26, 2024
Signed-off-by: Ivan Cholakov <icholakov1@gmail.com>
Co-authored-by: Ivan Cholakov <icholakov1@gmail.com>
Co-authored-by: Thanos <56822898+thadouk@users.noreply.github.com>
Co-authored-by: Michael <62653655+MBrozhko34@users.noreply.github.com>
thadouk added a commit that referenced this pull request Jun 26, 2024
Signed-off-by: Ivan Cholakov <icholakov1@gmail.com>
Co-authored-by: Ivan Cholakov <icholakov1@gmail.com>
Co-authored-by: Thanos <56822898+thadouk@users.noreply.github.com>
Co-authored-by: Michael <62653655+MBrozhko34@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.

5 participants