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: state update job #23

Merged
merged 52 commits into from
Jul 2, 2024
Merged

feat: state update job #23

merged 52 commits into from
Jul 2, 2024

Conversation

akhercha
Copy link
Member

@akhercha akhercha commented Jun 21, 2024

Resolves: #13
Follow-up issues: #28 #29

Added

  • State update job implementation + tests
  • ethereum & starknet settlement clients

Comments

TODO in a follow-up task: Implement the required arguments for update_state_calldata and update_state_blobs.

MaybePendingStateUpdate::Update(state_update) => state_update,
};
// TODO: how to build the required arguments?
settlement_client.update_state_calldata(vec![], vec![], 0).await?;
Copy link
Contributor

Choose a reason for hiding this comment

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

@akhercha akhercha marked this pull request as ready for review June 24, 2024 17:07
@akhercha akhercha requested a review from unstark June 24, 2024 17:32
@akhercha akhercha requested a review from apoorvsadana June 28, 2024 09:36
crates/orchestrator/src/jobs/state_update_job/mod.rs Outdated Show resolved Hide resolved
crates/orchestrator/src/jobs/state_update_job/mod.rs Outdated Show resolved Hide resolved
crates/orchestrator/src/jobs/state_update_job/mod.rs Outdated Show resolved Hide resolved
crates/orchestrator/src/database/mongodb/mod.rs Outdated Show resolved Hide resolved

#[rstest]
#[tokio::test]
async fn test_create_job() {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add a test case for retries as well? feel free to create an issue if you want it to be addresses in a new PR

Copy link
Member Author

Choose a reason for hiding this comment

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

Created an issue here:
#30

crates/settlement-clients/ethereum/src/lib.rs Outdated Show resolved Hide resolved
/// Wait for a pending tx to achieve finality
async fn wait_for_tx_finality(&self, tx_hash: &str) -> Result<()> {
let mut retries = 0;
// TODO: time to wait should be configurable in SettlementConfig?
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Added

Comment on lines 94 to 96
job_doc.insert("external_id", external_id);
job_doc.insert("status", bson::to_bson(&new_status)?);
job_doc.insert("metadata", bson::to_document(&metadata)?);
Copy link
Contributor

Choose a reason for hiding this comment

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

can we just take the job item only because that will have all the other stuff updated already

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated!

@apoorvsadana apoorvsadana merged commit 00fc6f5 into madara-alliance:main Jul 2, 2024
6 of 7 checks passed
Tranduy1dol pushed a commit to sota-zk-labs/madara-orchestrator that referenced this pull request Jul 9, 2024
* feat(state_update_job): Init work

* feat(state_update_job): Updated configurations with rpc_url & providers

* feat(state_update_job): StarknetValidityContract added

* feat(state_update_job): saving state

* feat(state_update_job): Cleanup

* feat(state_update_job): conversions

* feat(state_update_job): added test data

* feat(state_update_job): moonsoong fork

* feat(state_update_job): cleanup

* feat(state_update_job): cleaning

* feat(state_update_job): Cleaning up

* feat(state_update_job): Update

* feat(state_update_job): Quick update

* feat(state_update_job): Cleaning/Renaming tests files

* feat(state_update_job): vscode files ignored

* feat(state_update_job):

* feat(state_update_job): starknet settlement

* feat(state_update_job):

* feat(state_update_job): fixing tests

* feat(state_update_job): Fixed tests

* feat(state_update_job):

* feat(state_update_job): Validating blocks to settle

* feat(state_update_job): verify inclusion

* feat(state_update_job): Docs

* feat(state_update_job): Quick refinements

* feat(state_update_job): Refactoring + tests

* feat(state_update_job): should_panic quick update

* feat(state_update_job): Added reason for rejected status

* feat(state_update_job): More context for piltover contract

* feat(state_update_job): Added comment about zaun impl

* feat(state_update_job): Added test case

* feat(state_update_job): external_id = last_tx_hash executed + verify inclusion

* feat(state_update_job): Restored lcov.info

* feat(state_update_job): propagating error

* feat(state_update_job): SettingsProvider used

* feat(state_update_job): Empty: error

* feat(state_update_job): Updated TODO

* feat(state_update_job): Linting

* feat(state_update_job): Restricted state update type + Verify inclusion check

* feat(state_update_job): verify inclusion tx

* feat(state_update_job): Fixes from review

* feat(state_update_job): Sorting imports

* feat(state_update_job): Refinement

* feat(state_update_job): Fixed tests

* feat(state_update_job): Simple comments for context

* feat(state_update_job): Updating job

* feat(state_update_job): Fixes from code review

* feat(state_update_job): Fixes from review

* feat(state_update_job): Fix from review

* feat(state_update_job): Fixed linter
Tranduy1dol pushed a commit to sota-zk-labs/madara-orchestrator that referenced this pull request Jul 9, 2024
* feat(state_update_job): Init work

* feat(state_update_job): Updated configurations with rpc_url & providers

* feat(state_update_job): StarknetValidityContract added

* feat(state_update_job): saving state

* feat(state_update_job): Cleanup

* feat(state_update_job): conversions

* feat(state_update_job): added test data

* feat(state_update_job): moonsoong fork

* feat(state_update_job): cleanup

* feat(state_update_job): cleaning

* feat(state_update_job): Cleaning up

* feat(state_update_job): Update

* feat(state_update_job): Quick update

* feat(state_update_job): Cleaning/Renaming tests files

* feat(state_update_job): vscode files ignored

* feat(state_update_job):

* feat(state_update_job): starknet settlement

* feat(state_update_job):

* feat(state_update_job): fixing tests

* feat(state_update_job): Fixed tests

* feat(state_update_job):

* feat(state_update_job): Validating blocks to settle

* feat(state_update_job): verify inclusion

* feat(state_update_job): Docs

* feat(state_update_job): Quick refinements

* feat(state_update_job): Refactoring + tests

* feat(state_update_job): should_panic quick update

* feat(state_update_job): Added reason for rejected status

* feat(state_update_job): More context for piltover contract

* feat(state_update_job): Added comment about zaun impl

* feat(state_update_job): Added test case

* feat(state_update_job): external_id = last_tx_hash executed + verify inclusion

* feat(state_update_job): Restored lcov.info

* feat(state_update_job): propagating error

* feat(state_update_job): SettingsProvider used

* feat(state_update_job): Empty: error

* feat(state_update_job): Updated TODO

* feat(state_update_job): Linting

* feat(state_update_job): Restricted state update type + Verify inclusion check

* feat(state_update_job): verify inclusion tx

* feat(state_update_job): Fixes from review

* feat(state_update_job): Sorting imports

* feat(state_update_job): Refinement

* feat(state_update_job): Fixed tests

* feat(state_update_job): Simple comments for context

* feat(state_update_job): Updating job

* feat(state_update_job): Fixes from code review

* feat(state_update_job): Fixes from review

* feat(state_update_job): Fix from review

* feat(state_update_job): Fixed linter
Tranduy1dol pushed a commit to sota-zk-labs/madara-orchestrator that referenced this pull request Jul 9, 2024
* feat(state_update_job): Init work

* feat(state_update_job): Updated configurations with rpc_url & providers

* feat(state_update_job): StarknetValidityContract added

* feat(state_update_job): saving state

* feat(state_update_job): Cleanup

* feat(state_update_job): conversions

* feat(state_update_job): added test data

* feat(state_update_job): moonsoong fork

* feat(state_update_job): cleanup

* feat(state_update_job): cleaning

* feat(state_update_job): Cleaning up

* feat(state_update_job): Update

* feat(state_update_job): Quick update

* feat(state_update_job): Cleaning/Renaming tests files

* feat(state_update_job): vscode files ignored

* feat(state_update_job):

* feat(state_update_job): starknet settlement

* feat(state_update_job):

* feat(state_update_job): fixing tests

* feat(state_update_job): Fixed tests

* feat(state_update_job):

* feat(state_update_job): Validating blocks to settle

* feat(state_update_job): verify inclusion

* feat(state_update_job): Docs

* feat(state_update_job): Quick refinements

* feat(state_update_job): Refactoring + tests

* feat(state_update_job): should_panic quick update

* feat(state_update_job): Added reason for rejected status

* feat(state_update_job): More context for piltover contract

* feat(state_update_job): Added comment about zaun impl

* feat(state_update_job): Added test case

* feat(state_update_job): external_id = last_tx_hash executed + verify inclusion

* feat(state_update_job): Restored lcov.info

* feat(state_update_job): propagating error

* feat(state_update_job): SettingsProvider used

* feat(state_update_job): Empty: error

* feat(state_update_job): Updated TODO

* feat(state_update_job): Linting

* feat(state_update_job): Restricted state update type + Verify inclusion check

* feat(state_update_job): verify inclusion tx

* feat(state_update_job): Fixes from review

* feat(state_update_job): Sorting imports

* feat(state_update_job): Refinement

* feat(state_update_job): Fixed tests

* feat(state_update_job): Simple comments for context

* feat(state_update_job): Updating job

* feat(state_update_job): Fixes from code review

* feat(state_update_job): Fixes from review

* feat(state_update_job): Fix from review

* feat(state_update_job): Fixed linter
ocdbytes pushed a commit that referenced this pull request Oct 16, 2024
* feat(state_update_job): Init work

* feat(state_update_job): Updated configurations with rpc_url & providers

* feat(state_update_job): StarknetValidityContract added

* feat(state_update_job): saving state

* feat(state_update_job): Cleanup

* feat(state_update_job): conversions

* feat(state_update_job): added test data

* feat(state_update_job): moonsoong fork

* feat(state_update_job): cleanup

* feat(state_update_job): cleaning

* feat(state_update_job): Cleaning up

* feat(state_update_job): Update

* feat(state_update_job): Quick update

* feat(state_update_job): Cleaning/Renaming tests files

* feat(state_update_job): vscode files ignored

* feat(state_update_job):

* feat(state_update_job): starknet settlement

* feat(state_update_job):

* feat(state_update_job): fixing tests

* feat(state_update_job): Fixed tests

* feat(state_update_job):

* feat(state_update_job): Validating blocks to settle

* feat(state_update_job): verify inclusion

* feat(state_update_job): Docs

* feat(state_update_job): Quick refinements

* feat(state_update_job): Refactoring + tests

* feat(state_update_job): should_panic quick update

* feat(state_update_job): Added reason for rejected status

* feat(state_update_job): More context for piltover contract

* feat(state_update_job): Added comment about zaun impl

* feat(state_update_job): Added test case

* feat(state_update_job): external_id = last_tx_hash executed + verify inclusion

* feat(state_update_job): Restored lcov.info

* feat(state_update_job): propagating error

* feat(state_update_job): SettingsProvider used

* feat(state_update_job): Empty: error

* feat(state_update_job): Updated TODO

* feat(state_update_job): Linting

* feat(state_update_job): Restricted state update type + Verify inclusion check

* feat(state_update_job): verify inclusion tx

* feat(state_update_job): Fixes from review

* feat(state_update_job): Sorting imports

* feat(state_update_job): Refinement

* feat(state_update_job): Fixed tests

* feat(state_update_job): Simple comments for context

* feat(state_update_job): Updating job

* feat(state_update_job): Fixes from code review

* feat(state_update_job): Fixes from review

* feat(state_update_job): Fix from review

* feat(state_update_job): Fixed linter
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.

implement state update job
3 participants