Skip to content

Commit

Permalink
fixup! fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmikhalevich committed Mar 28, 2024
1 parent 78b5646 commit af9626d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion fs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RUN apt-get update && \
bash=5.1-6ubuntu1 \
psmisc=23.4-2build3 \
bc=1.07.1-3build1 \
curl=7.81.0-1ubuntu1.15 \
curl=7.81.0-1ubuntu1.16 \
device-tree-compiler=1.6.1-1 \
jq=1.6-2.1ubuntu3 \
lua5.4=5.4.4-1 \
Expand Down
3 changes: 1 addition & 2 deletions rollup-http/rollup-http-client/src/rollup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ use std::fmt;
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct AdvanceMetadata {
pub msg_sender: String,
pub epoch_index: u64,
pub input_index: u64,
pub block_number: u64,
pub timestamp: u64,
pub block_timestamp: u64,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
Expand Down
19 changes: 8 additions & 11 deletions rollup-http/rollup-http-server/src/rollup/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ impl Drop for RollupFd {
unsafe impl Sync for RollupFd {}
unsafe impl Send for RollupFd {}

pub const REQUEST_TYPE_ADVANCE_STATE: &str = "advance_state";
pub const REQUEST_TYPE_INSPECT_STATE: &str = "inspect_state";
pub const REQUEST_TYPE_ADVANCE_STATE: u32 = 0;
pub const REQUEST_TYPE_INSPECT_STATE: u32 = 1;
pub const CARTESI_ROLLUP_ADDRESS_SIZE: u32 = 20;

lazy_static! {
Expand Down Expand Up @@ -117,10 +117,9 @@ impl From<&mut RollupFinish> for cmt_rollup_finish_t {
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AdvanceMetadata {
pub msg_sender: String,
pub epoch_index: u64,
pub input_index: u64,
pub block_number: u64,
pub timestamp: u64,
pub block_timestamp: u64,
}

impl From<cmt_rollup_advance_t> for AdvanceMetadata {
Expand All @@ -129,8 +128,7 @@ impl From<cmt_rollup_advance_t> for AdvanceMetadata {
address.push_str(&hex::encode(&other.msg_sender));
AdvanceMetadata {
input_index: other.index,
epoch_index: other.block_number, // TODO: Check if it's correct
timestamp: other.block_timestamp,
block_timestamp: other.block_timestamp,
block_number: other.block_number,
msg_sender: address,
}
Expand Down Expand Up @@ -533,7 +531,7 @@ pub async fn handle_rollup_requests(
let next_request_type = finish_request.next_request_type as u32;

match next_request_type {
0 => {
REQUEST_TYPE_ADVANCE_STATE => {
log::debug!("handle advance state request...");
let advance_request = {
// Read advance request from rollup device
Expand All @@ -550,7 +548,7 @@ pub async fn handle_rollup_requests(
// Send newly read advance request to http service
Ok(RollupRequest::Advance(advance_request))
}
1 => {
REQUEST_TYPE_INSPECT_STATE => {
log::debug!("handle inspect state request...");
// Read inspect request from rollup device
let inspect_request = {
Expand Down Expand Up @@ -589,10 +587,9 @@ pub fn print_advance(advance: &AdvanceRequest) {
advance_request_printout.push_str("advance: {{msg_sender: ");
format_address_printout(&advance.metadata.msg_sender, &mut advance_request_printout);
advance_request_printout.push_str(&format!(
" block_number: {} timestamp: {} epoch_index: {} input_index: {} }}",
" block_number: {} block_timestamp: {} input_index: {} }}",
advance.metadata.block_number,
advance.metadata.timestamp,
advance.metadata.epoch_index,
advance.metadata.block_timestamp,
advance.metadata.input_index
));
log::debug!("{}", &advance_request_printout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ async fn test_finish_request(
{
Ok(request) => match request {
RollupRequest::Inspect(inspect_request) => {
//println!("Got new inspect request: {:?}", inspect_request);
println!("Got new inspect request: {:?}", inspect_request);
context.server_handle.stop(true).await;
assert_eq!(inspect_request.payload.len(), 10);
assert_eq!(
Expand Down

0 comments on commit af9626d

Please sign in to comment.