Skip to content

Commit

Permalink
Increase max obj size upto 1Mb
Browse files Browse the repository at this point in the history
  • Loading branch information
MikhailK committed Oct 30, 2024
1 parent fa53083 commit 889f216
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion pallets/poscan/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,11 @@ pub mod pallet {
let mut properties = BoundedVec::default();
properties.try_push(PropValue { prop_idx: 0, max_value: 1 }).unwrap();

let old_obj: Vec<_> = old_data.obj.into();

Some(ObjData::<T::AccountId, T::BlockNumber> {
state: old_data.state,
obj: old_data.obj,
obj: old_obj.try_into().unwrap(),
compressed_with: old_data.compressed_with,
category: old_data.category,
hashes: old_data.hashes,
Expand Down
5 changes: 3 additions & 2 deletions primitives/consensus/poscan/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ pub const HOURS: u32 = 60;
/// Block number of one day.
pub const DAYS: u32 = 24 * HOURS;

pub const MAX_OBJECT_SIZE: u32 = 100_000;
pub const MAX_OBJECT_SIZE_OLD: u32 = 100_000;
pub const MAX_OBJECT_SIZE: u32 = 1_000_000;
pub const MAX_PROPERTIES: u32 = 100;
pub const PROP_NAME_LEN: u32 = 64;
pub const DEFAULT_OBJECT_HASHES: u32 = 10;
Expand Down Expand Up @@ -352,7 +353,7 @@ pub struct OldObjData<Account, Block>
Block: Encode + Decode + TypeInfo + Member,
{
pub state: ObjectState<Block>,
pub obj: BoundedVec<u8, ConstU32<MAX_OBJECT_SIZE>>,
pub obj: BoundedVec<u8, ConstU32<MAX_OBJECT_SIZE_OLD>>,
pub compressed_with: Option<CompressWith>,
pub category: ObjectCategory,
pub hashes: BoundedVec<H256, ConstU32<MAX_OBJECT_HASHES>>,
Expand Down

0 comments on commit 889f216

Please sign in to comment.