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

Test: Ethereum Settlement Client #81

Merged
merged 45 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
84a3819
update: settlement-client: ethereum test cases for conversion fns
heemankv Aug 2, 2024
0c6d868
update: removed .expect from slice_u8_to_u256
heemankv Aug 2, 2024
f77093b
update: Eth Settlement client: tests for conversions
heemankv Aug 5, 2024
c23a4a6
update: Eth Settlement client : prepare_sidecar
heemankv Aug 5, 2024
5e2ea5e
update: settlement_client: eth: prepare_sidecar tests
heemankv Aug 5, 2024
f435b1d
chore: optimisations
heemankv Aug 6, 2024
229e50d
update: working test case
heemankv Aug 7, 2024
aa1bef2
update: working test #2
apoorvsadana Aug 7, 2024
3158c48
update: added cfg test for update_state_with_blobs
heemankv Aug 9, 2024
db1a675
update: cleaner cfg(test) implemented code for update_state_and_blob_…
heemankv Aug 9, 2024
d562e4c
chore: liniting fixes
heemankv Aug 9, 2024
69cc0b7
update: linting fixes
heemankv Aug 12, 2024
46fc944
docs: changelog
heemankv Aug 12, 2024
c6bfdce
update: Nonce prefetch for state_update
heemankv Aug 13, 2024
f3fc826
update: creation of input_data works
heemankv Aug 13, 2024
d28b98b
update: using correct input bytes
heemankv Aug 13, 2024
a03f9db
chore: lint fix
heemankv Aug 13, 2024
06d97cd
update: test normal transaction
heemankv Aug 14, 2024
5aa7b10
update: dummy contract and impersonation tests ready
heemankv Aug 14, 2024
e7023af
update: test cases for settlement client
heemankv Aug 14, 2024
391d693
chore: lint fixes
heemankv Aug 14, 2024
856fa1f
chore: fix lints
heemankv Aug 14, 2024
a03387f
Merge branch 'main' into test/settlement-client
heemankv Aug 14, 2024
6b69fdd
update: Changes for PR review
heemankv Aug 16, 2024
bbecc38
chore: fixing test cases for eth settlement client
heemankv Aug 16, 2024
01294a0
update: tests fix
heemankv Aug 16, 2024
1178e22
chore: lint fix
heemankv Aug 16, 2024
acf9738
Merge branch 'main' into test/settlement-client
heemankv Aug 16, 2024
60fac37
chore: lint fix
heemankv Aug 16, 2024
3a125ad
update: path fix
heemankv Aug 16, 2024
e2a0bed
update: testing anvil install on gh
heemankv Aug 16, 2024
92aa145
update: fixing path
heemankv Aug 16, 2024
6c03f7b
update: added Blast rpc for eth
heemankv Aug 16, 2024
a3c0863
update: Coverage CI fixes
heemankv Aug 16, 2024
d0ddfde
update: correct Pr checks
heemankv Aug 16, 2024
4de6e8b
update: PR reviews fixes
heemankv Aug 17, 2024
ebe967e
update: PR reviews fixes
heemankv Aug 17, 2024
ef35e52
update: adding rationale for update_state_blob_with_impersonation_wor…
heemankv Aug 17, 2024
a8f4bb1
update: cleaner test integration on update_state_with_blobs
heemankv Aug 18, 2024
30e8584
update: removing EthProvider
heemankv Aug 18, 2024
ef5a562
Reworking Settlement Client Changes (#89)
apoorvsadana Aug 20, 2024
6b7a656
Merge branch 'main' into test/settlement-client
heemankv Aug 23, 2024
8e9c13d
Merge branch 'main' into test/settlement-client
heemankv Aug 23, 2024
b93372e
update PR reviews fixed
heemankv Aug 23, 2024
f9d3682
update PR reviews fixed
heemankv Aug 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,15 @@ SQS_WORKER_TRIGGER_QUEUE_URL=
AWS_S3_BUCKET_NAME=
AWS_S3_BUCKET_REGION=


# Ethereum Settlement
DEFAULT_SETTLEMENT_CLIENT_RPC=
DEFAULT_L1_CORE_CONTRACT_ADDRESS=

# Sharp Services
SHARP_CUSTOMER_ID=
SHARP_USER_CRT=
SHARP_USER_KEY=
SHARP_SERVER_CRT=
SHARP_PROOF_LAYOUT=
SHARP_PROOF_LAYOUT=

9 changes: 8 additions & 1 deletion .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ MADARA_RPC_URL="http://localhost:3000"
ETHEREUM_RPC_URL="http://localhost:3001"
MEMORY_PAGES_CONTRACT_ADDRESS="0x000000000000000000000000000000000001dead"
PRIVATE_KEY="0xdead"
ETHEREUM_PRIVATE_KEY="0x000000000000000000000000000000000000000000000000000000000000beef"
# Private key of Test wallet provided by Anvil
ETHEREUM_PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"

Choose a reason for hiding this comment

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

Are you okay with this being public? If this is not a problem, document why this is set in Github.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ideally, we can remove this but it's genuinely no harm since this is Private_key provided by Anvil, will add a comment to explain the same

STARKNET_SOLIDITY_CORE_CONTRACT_ADDRESS="0x000000000000000000000000000000000002dead"

##### Config URLs #####
Expand All @@ -27,6 +28,12 @@ PROVER_SERVICE="sharp"
SETTLEMENT_LAYER="ethereum"
DATA_STORAGE="s3"
MONGODB_CONNECTION_STRING="mongodb://localhost:27017"
DEFAULT_SETTLEMENT_CLIENT_RPC="http://localhost:3000"

# Ethereum Settlement
DEFAULT_L1_CORE_CONTRACT_ADDRESS="0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4"
SHOULD_IMPERSONATE_ACCOUNT="true"
TEST_DUMMY_CONTRACT_ADDRESS="0xE5b6F5e695BA6E4aeD92B68c4CC8Df1160D69A81"

# Sharp Services
SHARP_CUSTOMER_ID="sharp_consumer_id"
Expand Down
31 changes: 25 additions & 6 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
name: Rust Test & Coverage

on:
workflow_dispatch:
pull_request_target:
branches:
- main
types: [opened, synchronize, reopened]
push:
branches-ignore:
- main
workflow_call:
workflow_dispatch:

jobs:
coverage:
Expand Down Expand Up @@ -40,6 +47,20 @@ jobs:
- name: Rust Cache
uses: Swatinem/rust-cache@v2

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Check Anvil Installation
run: |
if command -v anvil &> /dev/null
then
echo "Anvil is installed. Version information:"
anvil --version
else
echo "Anvil is not installed or not in PATH"
exit 1
fi

- name: Install cargo-llvm-cov & nextest
uses: taiki-e/install-action@cargo-llvm-cov

Expand All @@ -50,11 +71,9 @@ jobs:
run: |
wget -P ./crates/prover-services/sharp-service/tests/artifacts https://madara-orchestrator-sharp-pie.s3.amazonaws.com/238996-SN.zip

- name: Clean workspace
run: |
cargo clean --doc

- name: Run tests llvm-cov
- name: Run llvm-cov tests
env:
ETHEREUM_BLAST_RPC_URL: ${{ secrets.ETHEREUM_BLAST_RPC_URL }}
run: cargo llvm-cov nextest --release --lcov --output-path lcov.info --test-threads=1

- name: Coveralls
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/linters-cargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ name: Task - Linters Cargo
on:
workflow_dispatch:
workflow_call:
push:

jobs:
cargo-lint:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ name: Task - Linters
on:
workflow_dispatch:
workflow_call:
push:

jobs:
prettier:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
name: Workflow - Pull Request

on:
workflow_dispatch:
pull_request:
pull_request_target:
branches: [main]
push:
branches: [main]
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/rust-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ name: Task - Build Rust
on:
workflow_dispatch:
workflow_call:
push:

jobs:
rust_build:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## Added

- Tests for Settlement client.
- Worker queues to listen for trigger events.
- Tests for prover client.
- Added Rust Cache for Coverage Test CI.
Expand Down
Loading
Loading