Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Use max CCU size to collect CCM #7458

Closed
Tracked by #6918
ishantiw opened this issue Aug 30, 2022 · 1 comment · Fixed by #7872
Closed
Tracked by #6918

Use max CCU size to collect CCM #7458

ishantiw opened this issue Aug 30, 2022 · 1 comment · Fixed by #7872

Comments

@ishantiw
Copy link
Contributor

ishantiw commented Aug 30, 2022

Description

Add a mechanism to check for max CCU size that is accepted by the network and based on that we create a CCU with number of CCMs it can hold making sure it respects the overall size of CCU transaction.

  • we need to calculate the max CCU size ~15kb and determine the number of CCMs that can be included in a sequence. For ex, ccm1, ccm2, ccm3, ccm4, ccm5,..ccm(n) where ccm2 is at the certified height, then we chose from ccm3 to ccm(n) in a way that we can fit into max CCU size, sizeOf[ccm3....ccm(m)] < MAX_CCU_SIZE taking rest of the properties of CCU transaction into account.

  • In the newBlockHandler, before calling createCCU. We call the function getListOfCCM(ccm []) => list of ccm where getListOfCCM implements the above logic and returns a list of CCMs that can be included in a CCU respecting max size.

Acceptance Criteria

  • A CCU with size under max size is created including sufficiently large CCMs

Additional Information

@milenagojkovic milenagojkovic added this to the Sprint 77 milestone Sep 1, 2022
@milenagojkovic milenagojkovic modified the milestones: Sprint 77, Sprint 78 Sep 11, 2022
@shuse2 shuse2 added this to the Sprint 83 milestone Nov 21, 2022
@sitetester sitetester self-assigned this Dec 1, 2022
@Madhulearn Madhulearn modified the milestones: Sprint 83, Sprint 84 Dec 5, 2022
@shuse2
Copy link
Collaborator

shuse2 commented Dec 8, 2022

Max size of CCMs which can be included into the CCU is

export const MAX_CCM_SIZE = 10240

This is based on the maximum size of CCU which can be included into the mainchain block.

@ishantiw ishantiw linked a pull request Dec 12, 2022 that will close this issue
@ishantiw ishantiw changed the title Use max CCU size to collect CCM and create a CCU instead of number of CCMs Use max CCU size to collect CCM Dec 15, 2022
@Madhulearn Madhulearn modified the milestones: Sprint 84, Sprint 85 Dec 19, 2022
ishantiw added a commit that referenced this issue Jan 2, 2023
### What was the problem?

This PR resolves #7458

### How was it solved?

Cross chain messages are now grouped into a collection < MAX_CCM_SIZE,
each group could be used to create a CCU

### How was it tested?
Test cases added
@ishantiw ishantiw closed this as completed Jan 2, 2023
@Madhulearn Madhulearn modified the milestones: Sprint 85, Sprint 86 Jan 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants