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: add DA (only pub_data) #83

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions src/block_submitter/task_fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ impl TaskFetcher {
block_id: i64,
public_input: Vec<u8>,
proof: Vec<u8>,
public_data: Vec<u8>,
}

let query: &'static str = const_format::formatcp!(
r#"
select t.block_id as block_id,
t.public_input as public_input,
t.proof as proof
l2b.raw_public_data as public_data
from {} t
inner join {} l2b
on t.block_id = l2b.block_id
Expand All @@ -72,10 +74,13 @@ impl TaskFetcher {
if let Some(task) = task {
let public_inputs: Vec<U256> = serde_json::de::from_slice(&task.public_input)?;
let serialized_proof: Vec<U256> = serde_json::de::from_slice(&task.proof)?;
// TODO: maybe https://github.com/fluidex/rollup-state-manager/issues/246?
// let public_data: Vec<u8> = serde_json::de::from_slice(&task.public_data)?;
tx.try_send(ContractCall::SubmitBlock(SubmitBlockArgs {
block_id: task.block_id.into(),
public_inputs,
serialized_proof,
public_data: task.public_data,
}))?;
self.last_block_id = Some(task.block_id);
}
Expand Down
1 change: 1 addition & 0 deletions src/block_submitter/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ pub struct SubmitBlockArgs {
pub block_id: U256,
pub public_inputs: Vec<U256>,
pub serialized_proof: Vec<U256>,
pub public_data: Vec<u8>,
}