This PR intends to solve the stack overflow issue in pRuntime by boxing the large values in OrdMap.
In the previous implementation, we utilize OrdMap<H256, Contract> to store the contract info, where sizeof::<Contract> == 1064. Even though the size of Contract is approximately 1k, the OrdMap::insert demanded an over 8MB stack in certain scenarios. (Not sure why!)
After being boxed, it works fine when 200,000 contracts are deployed, with a 300k stack size.
This PR intends to solve the stack overflow issue in pRuntime by boxing the large values in OrdMap. In the previous implementation, we utilize
OrdMap<H256, Contract>
to store the contract info, wheresizeof::<Contract> == 1064
. Even though the size of Contract is approximately 1k, theOrdMap::insert
demanded an over 8MB stack in certain scenarios. (Not sure why!)After being boxed, it works fine when 200,000 contracts are deployed, with a 300k stack size.