-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: state update job #23
Conversation
MaybePendingStateUpdate::Update(state_update) => state_update, | ||
}; | ||
// TODO: how to build the required arguments? | ||
settlement_client.update_state_calldata(vec![], vec![], 0).await?; |
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.
You probably can reuse https://github.com/karnotxyz/madara-orchestrator/blob/cb74280a520b73c1b905461373db487a54731aef/crates/prover-services/gps-fact-checker/src/fact_node.rs#L49 but you need the right leaf (not the root)
And the size of the onchain part is len(program_output) - main part size https://github.com/starkware-libs/cairo-lang/blob/efa9648f57568aad8f8a13fbf027d2de7c63c2c0/src/starkware/starknet/core/os/output.cairo#L198
crates/settlement-clients/ethereum/src/clients/interfaces/validity_interface.rs
Show resolved
Hide resolved
|
||
#[rstest] | ||
#[tokio::test] | ||
async fn test_create_job() { |
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.
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
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.
Created an issue here:
#30
/// 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? |
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.
Yes :)
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.
Added
job_doc.insert("external_id", external_id); | ||
job_doc.insert("status", bson::to_bson(&new_status)?); | ||
job_doc.insert("metadata", bson::to_document(&metadata)?); |
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.
can we just take the job item only because that will have all the other stuff updated already
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.
Updated!
* 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
* 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
* 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
* 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
Resolves: #13
Follow-up issues: #28 #29
Added
Comments
TODO in a follow-up task: Implement the required arguments for
update_state_calldata
andupdate_state_blobs
.