kfastov / worldcoin-bridge-linea

World ID state bridge for Linea
MIT License
6 stars 24 forks source link

tests: Implement end-to-end tests for the entire World ID state bridge system #4

Closed kfastov closed 2 months ago

kfastov commented 4 months ago

Description

You need to create comprehensive end-to-end tests for the entire World ID state bridge system. to ensure that all components work together correctly and that the cross-chain functionality operates as expected.

Tasks

  1. Look up the best practices of how cross-domain messaging is tested on Linea (see linea-contracts repo, any other repos and sources that may be helpful)
  2. Write automated tests for our bridge according to those best practices. They should cover all basic functionality: initialization of both contracts, propagating roots from L1 using LineaStateBridge, receiving and processing those roots on L2 with LineaWorldID contract
  3. Test various scenarios, including:
    • Normal operation (successful state updates by authorized senders)
    • Edge cases (e.g., fraud updates from unauthorized addresses)

Acceptance Criteria

Caveats

Resources

Immanuelolivia1 commented 4 months ago

I would like to work on this

pope-h commented 4 months ago

For testing would you require forking the mainnet or is foundry test enough? @kfastov

gidson5 commented 4 months ago

Can I take this on?

kfastov commented 4 months ago

@pope-h @gidson5 Could you please also leave a message in Telegram? If you already did it and your TG username is different than on Github, please send me your Github username on TG

kfastov commented 4 months ago

@pope-h I think Foundry tests are enough here, if they cover the entire flow of both contracts. Other parts, like World ID identity contract can be mocked. Then, we can deploy everything to testnet and integrate with existing Worldcoin contracts there, but maybe I'll create a separate task for it.

MukulKolpe commented 4 months ago

Hello @kfastov,

I am a full-stack developer with extensive experience in various open-source projects. I am excited about the opportunity to contribute and would love to work on this issue during ODHack 5.0. I have significant expertise in Solidity, including writing comprehensive test suites with high coverage, as well as performing invariant and fuzz testing.

Here is a link to my OnlyDust profile: https://app.onlydust.com/u/MukulKolpe

vmmuthu31 commented 4 months ago

Hyy, @kfastov. I’m interested in this task.

gidson5 commented 4 months ago

@pope-h @gidson5 Could you please also leave a message in Telegram? If you already did it and your TG username is different than on Github, please send me your Github username on TG

Hy @kfastov i already left you a message on TG

kfastov commented 4 months ago

@MukulKolpe Hi! The PRs for the contracts are already merged, so you can now finally test the actual contracts

MukulKolpe commented 4 months ago

Perfect, I'll have the draft PR ready soon.

kfastov commented 3 months ago

Hi @MukulKolpe ! Can you please share your progress on this issue?

kfastov commented 3 months ago

Sorry @MukulKolpe I don't want somebody to duplicate your work, but I'll have to assign this issue to someone else to get it done

Jemiiah commented 3 months ago

I would love to work on this issue @kfastov

MukulKolpe commented 3 months ago

Hi @kfastov, I apologize for the delay; I got caught up with some work. Please feel free to assign it to someone else.

kfastov commented 3 months ago

@MukulKolpe No problem at all, thank you for the update. Please feel free to return whenever you have time

zarah-s commented 3 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

With my strong background in Rust, Solidity and JavaScript, I can apply my expertise in solving this issue

Jemiiah commented 3 months ago

@kfastov i commented earlier I would still love to work on this issue ser🚀

DevSwayam commented 3 months ago

I would like to work on this issue. I am applying via OD Hacks.

Scope:
This issue has been assigned as medium difficulty but could also be considered high difficulty.

Why high difficulty?
The contract needs to be tested with stateless and stateful fuzzing tests to ensure it can handle edge cases for both unit and integration tests.

Why me?
I am well-suited for this work. I know how to perform integration, unit, and stateful/stateless fuzzing. I can also use static analysis tools to find bugs and provide a comprehensive audit report that will be valuable in the long term. Additionally, I am capable of writing code for migrating and resolving issues.

Jemiiah commented 3 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I'm a web3 blockchain developer who have experience interacting with solidity and Cairo codes and would be able to tackle the issue

How I plan on tackling this issue

Review the documentation and code examples in the Linea contracts repository. • Look for any testing frameworks or strategies they use for cross-domain messaging. • Study other repositories or documentation related to cross-chain communication, such as those from projects like Polkadot, Cosmos, or similar.

Use a testing framework like Foundry or Hardhat. • Write test scripts that: • Deploy the LineaStateBridge and LineaWorldID contracts. • Initialize the contracts and verify their initial states. • Simulate cross-chain messages by propagating roots from L1 using LineaStateBridge and receiving them on L2 using LineaWorldID. • Include assertions to verify that the state transitions occur as expected.

Abhi270303 commented 3 months ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi, I am a Solidity developer, I prefer Foundry framework for testing smart contracts, I have decent experience in Writing Deploy Scripts for contracts and also Write Unit tests for testing contracts. I have also done Stateless fuzz testing. I always try to maintain the code quality so that it is easier for developers to understand the code. I believe my background can be leveraged to contribute to Worldcoin-bridge-linea.

How I plan on tackling this issue

I will make a folder for scipts, Two files will be included DeployBridge.s.sol & HelperConfig.s.sol. DeployBridge would be having Deploy Scripts inside & HelperConfig will be consisting of LocalAnvilEth Config, SepoliaEthConfig & SepoliaLineaConfig for easily deploying contracts, after that I will write tests in test folder , In tests there will be setUp and Tests for each functionality of bridge to test if it is working properly, and forge coverage will give me idea of how much codebase I have covered.

DIWAKARKASHYAP commented 2 months ago

i want to work on this issue