-
Notifications
You must be signed in to change notification settings - Fork 56
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: L3 support #437
Open
ocdbytes
wants to merge
58
commits into
main
Choose a base branch
from
l3-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: L3 support #437
Changes from 44 commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
8949443
feat : l3 support init
ocdbytes abc808e
code : refactor
ocdbytes a49e209
feat : added tests for starknet client
ocdbytes 0d6168e
changelog update
ocdbytes 76bc944
Merge branch 'main' into l3-support
ocdbytes 75229a4
fix : lint
ocdbytes 661cd33
feat: added update state worker test for starknet client
ocdbytes 62fb337
feat : added messaging implementation for l2 client & resolved commen…
ocdbytes d4aa988
feat : updated l2 messaging implementation
ocdbytes a4314be
feat : updated l2 messaging implementation
ocdbytes 9dea223
feat : updated messaging logic
ocdbytes fafd2c3
clients refactoring done
ocdbytes aa7834e
refactor : tests
ocdbytes 6c1ff95
fix : tests
ocdbytes 26c9319
feat : updated streams and added tests for streams
ocdbytes 2a19391
fix : changed event params in messaging contract
ocdbytes 8abf999
refactor : removed external devnet.yaml file
ocdbytes 749df1c
feat : removed expects
ocdbytes b63cf61
refactor crates structure
ocdbytes c837570
merge main
ocdbytes 1d4d3a4
resolved comments
ocdbytes fffd9dd
refactor
ocdbytes 71c5524
feat : added automock tests and resolved comments
ocdbytes 62d1df3
merge : main
ocdbytes 79ef5ab
refactor
ocdbytes 8657da3
refactor code and comments resolved
ocdbytes 7afd1a3
Merge branch 'main' into l3-support
Mohiiit c2ba583
refactor: eth settlement client test udpated to use same anvil instance
Mohiiit 885ae41
refactor: test simplified
Mohiiit ab24677
fix(eth-settlement): error handling cases fixed
Mohiiit 2349d33
refactor(eth-settlement): fold pattern used
Mohiiit 545c5b5
refactor(eth-settlement): event stream tests removed code duplication
Mohiiit 704ca2d
refactor(settlement-client): SettlementClientError introduced replaci…
Mohiiit 8e17399
refactor(settlement-client): SettlmentClientError added for every any…
Mohiiit 22e4586
fix(settlement-client): messagin tests working, new removed from Clie…
Mohiiit 77ad470
refactor(settlement-client): clientTrait changed to settlementClientT…
Mohiiit a55eb4e
chore(settlment-client): resolving comments regarding automock and na…
Mohiiit 156bd33
chore(settlement-client): comments resolved in starknet settlement cl…
Mohiiit 911cb87
chore(settlement-client): starknet test working
Mohiiit 949826c
chore(settlement-client): cargo.toml cleaned
Mohiiit 46ece21
chore(github-workflow): workflow updated to use cached madara binary
Mohiiit 4cc7b99
chore: linting and formatting
Mohiiit 4d6ef19
fix(settlement-client): madara drop issue fixed, linting and formatting
Mohiiit 2b9ace3
Merge branch 'main' into l3-support
Mohiiit 5664430
Merge branch 'main' into l3-support
Mohiiit b96b091
refactor(settlement-client): introducing trait specific error type
Mohiiit bdadcda
refactor(settlement-client): introducing common error to the rest of …
Mohiiit 4d3489e
refactor(settlement-client): updating the context and other error han…
Mohiiit aee128b
refactor(settlement-client): error handling resolved
Mohiiit 75a5692
chore: merging main with l3-support
Mohiiit 039a73b
chore: main merged
Mohiiit eb85f68
chore: rust-toolchain updated
Mohiiit ecf3f8c
refactor(settlement-client): tests refactored to drop db
Mohiiit 95cadd3
fix(test)(settlement-client): messaging test fixed
Mohiiit 734df0d
linting: toml filed linted
Mohiiit b7ddb02
refactor(settlement-client): errors improved
Mohiiit d4fd1a2
fix(l1-txn): l2<>l3 messages were breaking because of the conversion,…
Mohiiit 9750d43
chore(linting): formatting and linting, fixing one test
Mohiiit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,24 @@ jobs: | |
- uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
- name: Launch Anvil | ||
run: anvil --fork-url $ANVIL_FORK_URL --fork-block-number $ANVIL_BLOCK_NUMBER & | ||
env: | ||
ANVIL_FORK_URL: "https://eth.merkle.io" | ||
ANVIL_BLOCK_NUMBER: 20395662 | ||
- name: Wait for Anvil to be ready | ||
run: | | ||
while ! nc -z localhost 8545; do | ||
sleep 1 | ||
done | ||
# TODO : For now madara binary is stored in aws s3 bucket : | ||
# After the proper release binaries are implemented | ||
# We can directly use that and we can remove this | ||
# temporary AWS implementation | ||
- name: Download madara binary for l2 client testing | ||
run: | | ||
curl -L https://madara-test-binary.s3.us-west-1.amazonaws.com/madara-linux -o ./test-artifacts/madara | ||
chmod +x ./test-artifacts/madara | ||
Comment on lines
+37
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
|
||
- name: Run unit tests | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#[starknet::contract] | ||
mod StateUpdateContract { | ||
type StateRoot = felt252; | ||
type BlockNumber = felt252; | ||
type BlockHash = felt252; | ||
|
||
#[storage] | ||
struct Storage { | ||
state_root: StateRoot, | ||
block_number: BlockNumber, | ||
block_hash: BlockHash, | ||
} | ||
|
||
#[event] | ||
#[derive(Drop, starknet::Event)] | ||
enum Event { | ||
LogStateUpdate: LogStateUpdate | ||
} | ||
|
||
#[derive(Drop, starknet::Event)] | ||
struct LogStateUpdate { | ||
state_root: felt252, | ||
block_number: felt252, | ||
block_hash: felt252, | ||
} | ||
|
||
#[constructor] | ||
fn constructor(ref self: ContractState) { | ||
// Initialize with default values | ||
self.state_root.write(0); | ||
self.block_number.write(0); | ||
self.block_hash.write(0); | ||
} | ||
|
||
#[external(v0)] | ||
fn update_state( | ||
ref self: ContractState, | ||
block_number: BlockNumber, | ||
state_root: StateRoot, | ||
block_hash: BlockHash | ||
) { | ||
self.state_root.write(state_root); | ||
self.block_number.write(block_number); | ||
self.block_hash.write(block_hash); | ||
|
||
self.emit(LogStateUpdate { state_root, block_number, block_hash, }); | ||
} | ||
|
||
#[external(v0)] | ||
fn get_state(self: @ContractState) -> (StateRoot, BlockNumber, BlockHash) { | ||
(self.state_root.read(), self.block_number.read(), self.block_hash.read()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
|
||
pub mod test_account; | ||
pub mod hello; | ||
pub mod appchain_test; | ||
pub mod messaging_test; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure this is necessary? If I remember the rust unit tests should start anvil anyway no?