diff --git a/fs/Dockerfile b/fs/Dockerfile index d8c4c45b..2259ba0d 100644 --- a/fs/Dockerfile +++ b/fs/Dockerfile @@ -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 \ diff --git a/rollup-http/rollup-http-client/src/rollup.rs b/rollup-http/rollup-http-client/src/rollup.rs index 93e06da6..9304b2b4 100644 --- a/rollup-http/rollup-http-client/src/rollup.rs +++ b/rollup-http/rollup-http-client/src/rollup.rs @@ -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)] diff --git a/rollup-http/rollup-http-server/src/rollup/mod.rs b/rollup-http/rollup-http-server/src/rollup/mod.rs index 5a61a1f8..eb2f5860 100644 --- a/rollup-http/rollup-http-server/src/rollup/mod.rs +++ b/rollup-http/rollup-http-server/src/rollup/mod.rs @@ -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! { @@ -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 for AdvanceMetadata { @@ -129,8 +128,7 @@ impl From 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, } @@ -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 @@ -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 = { @@ -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); diff --git a/rollup-http/rollup-http-server/tests/rollup-http-server-tests.rs b/rollup-http/rollup-http-server/tests/rollup-http-server-tests.rs index 2ff83fe7..e83368ab 100644 --- a/rollup-http/rollup-http-server/tests/rollup-http-server-tests.rs +++ b/rollup-http/rollup-http-server/tests/rollup-http-server-tests.rs @@ -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!(