-
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 : added aws s3 adapter and data storage trait #27
Conversation
Here's the code health analysis summary for commits Analysis Summary
|
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.
we're using -
instead of _
in file and crate names as a convention
const SNOS_OUTPUT_FILE_NAME: &str = "snos_output.json"; | ||
const KZG_FILE_NAME: &str = "kzg.txt"; |
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.
s3 shouldn't be aware of this, these details can be in the snos job. also, do we need to store kzg now? i was thinking we can calculate the proof when we calculate state diffs in update state only
|
||
#[async_trait] | ||
impl DataStorage for AWSS3 { | ||
async fn get_snos_data_for_block(&self, block_number: u128) -> Result<StarknetOsOutput, Error> { |
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.
same as above, S3 should have no idea on what snos is. s3 should only have get and put functions.
…xyz/madara-orchestrator into feat/data-storage-adapter
.env.example
Outdated
AWS_S3_KEY_SECRET= |
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.
so, I think, as long as AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
are in the env variables, aws sdk automatically fetches the config. like, we never initialise the SQS config in the orchestrator, it just works. although we do use a wrapper library as well so maybe that handles it automatically but i mostly think its the aws sdk itself. and in that case, i think we can just have one aws access key and secret for all AWS services
|
||
#[async_trait] | ||
impl DataStorage for AWSS3 { | ||
async fn get_data_for_block(&self, key: &str) -> Result<StarknetOsOutput, Error> { |
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.
it should be just get_data
and it should return just bytes. if we hardcode StarknetOsOutput
, I can't use S3 later on with the DA layer for example in case I want to store it in s3
Ok(json) | ||
} | ||
|
||
async fn put_data_for_block(&self, data: StarknetOsOutput, key: &str) -> Result<usize, Error> { |
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.
same as above
// | ||
// #[rstest] | ||
// #[tokio::test] | ||
// async fn test_put_data_in_bucket() { |
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.
is this pending?
…xyz/madara-orchestrator into feat/data-storage-adapter
* feat : added aws s3 adapter and data storage trait * updated .env * style: format code with Rustfmt This commit fixes the style issues introduced in 7e65299 according to the output from Rustfmt. Details: madara-alliance#27 * feat : removed redundant functions * style: format code with Rustfmt This commit fixes the style issues introduced in 59ce0a9 according to the output from Rustfmt. Details: madara-alliance#27 * feat : added bucket tests for local testing * feat : renamed funcs and cleanup * style: format code with Rustfmt This commit fixes the style issues introduced in c47e330 according to the output from Rustfmt. Details: madara-alliance#27 * feat : removed deepsource.toml file * feat : lint fix * feat : added comments for functions and impls as suggested by deepsource * fix : deepsource doc recommendation fix * refactor --------- Co-authored-by: Arun Jangra <[email protected]> Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
* feat : added aws s3 adapter and data storage trait * updated .env * style: format code with Rustfmt This commit fixes the style issues introduced in 7e65299 according to the output from Rustfmt. Details: madara-alliance#27 * feat : removed redundant functions * style: format code with Rustfmt This commit fixes the style issues introduced in 59ce0a9 according to the output from Rustfmt. Details: madara-alliance#27 * feat : added bucket tests for local testing * feat : renamed funcs and cleanup * style: format code with Rustfmt This commit fixes the style issues introduced in c47e330 according to the output from Rustfmt. Details: madara-alliance#27 * feat : removed deepsource.toml file * feat : lint fix * feat : added comments for functions and impls as suggested by deepsource * fix : deepsource doc recommendation fix * refactor --------- Co-authored-by: Arun Jangra <[email protected]> Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
* feat : added aws s3 adapter and data storage trait * updated .env * style: format code with Rustfmt This commit fixes the style issues introduced in 7e65299 according to the output from Rustfmt. Details: #27 * feat : removed redundant functions * style: format code with Rustfmt This commit fixes the style issues introduced in 59ce0a9 according to the output from Rustfmt. Details: #27 * feat : added bucket tests for local testing * feat : renamed funcs and cleanup * style: format code with Rustfmt This commit fixes the style issues introduced in c47e330 according to the output from Rustfmt. Details: #27 * feat : removed deepsource.toml file * feat : lint fix * feat : added comments for functions and impls as suggested by deepsource * fix : deepsource doc recommendation fix * refactor --------- Co-authored-by: Arun Jangra <[email protected]> Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
S3 Implementation
Issue : #24