diff --git a/protocol/src/protocol_generated.rs b/protocol/src/protocol_generated.rs index b04ba3337e..00a2896e55 100644 --- a/protocol/src/protocol_generated.rs +++ b/protocol/src/protocol_generated.rs @@ -1,6 +1,10 @@ // automatically generated by the FlatBuffers compiler, do not modify +#![allow(dead_code)] +#![allow(unused_imports)] +extern crate flatbuffers; + pub mod ckb { #![allow(dead_code)] #![allow(unused_imports)] diff --git a/protocol/src/protocol_generated_verifier.rs b/protocol/src/protocol_generated_verifier.rs index ceb0d5ea37..5ff07b1184 100644 --- a/protocol/src/protocol_generated_verifier.rs +++ b/protocol/src/protocol_generated_verifier.rs @@ -52,12 +52,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -65,6 +59,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -136,12 +131,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -149,6 +138,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -271,12 +261,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -284,6 +268,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -356,12 +341,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -369,6 +348,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -450,12 +430,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -463,6 +437,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -534,12 +509,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -547,6 +516,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -583,6 +553,15 @@ pub mod ckb { } } + if Self::VT_VALID_SINCE as usize + flatbuffers::SIZE_VOFFSET + <= vtab_num_bytes + { + let voffset = vtab.get(Self::VT_VALID_SINCE) as usize; + if voffset > 0 && object_inline_num_bytes - voffset < 8 { + return Err(Error::OutOfBounds); + } + } + if Self::VT_ARGS as usize + flatbuffers::SIZE_VOFFSET <= vtab_num_bytes { @@ -637,12 +616,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -650,6 +623,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -758,12 +732,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -771,6 +739,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -825,12 +794,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -838,6 +801,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -987,12 +951,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -1000,6 +958,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -1102,12 +1061,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -1115,6 +1068,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -1195,12 +1149,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -1208,6 +1156,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -1288,12 +1237,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -1301,6 +1244,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -1372,12 +1316,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -1385,6 +1323,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -1474,12 +1413,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -1487,6 +1420,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -1652,12 +1586,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -1665,6 +1593,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -1737,12 +1666,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -1750,6 +1673,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -1828,12 +1752,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -1841,6 +1759,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -1929,12 +1848,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -1942,6 +1855,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -2014,12 +1928,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -2027,6 +1935,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -2129,12 +2038,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -2142,6 +2045,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -2232,12 +2136,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -2245,6 +2143,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -2334,12 +2233,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -2347,6 +2240,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -2457,12 +2351,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -2470,6 +2358,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -2533,12 +2422,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -2546,6 +2429,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -2615,12 +2499,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -2628,6 +2506,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -2745,12 +2624,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -2758,6 +2631,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes) @@ -2844,12 +2718,6 @@ pub mod ckb { let vtab = tab.vtable(); let vtab_num_bytes = vtab.num_bytes(); - let object_inline_num_bytes = vtab.object_inline_num_bytes(); - if vtab_num_bytes < flatbuffers::SIZE_VOFFSET + flatbuffers::SIZE_VOFFSET - || object_inline_num_bytes < flatbuffers::SIZE_SOFFSET - { - return Err(Error::OutOfBounds); - } if vtab_loc .checked_add(vtab_num_bytes) .filter(|loc| *loc <= buf_len) @@ -2857,6 +2725,7 @@ pub mod ckb { { return Err(Error::OutOfBounds); } + let object_inline_num_bytes = vtab.object_inline_num_bytes(); if tab .loc .checked_add(object_inline_num_bytes)