-
Notifications
You must be signed in to change notification settings - Fork 168
Labels
maintenanceTasks that are planned to be done as part of the regular maintenance of the project.Tasks that are planned to be done as part of the regular maintenance of the project.
Description
Switching away from UMap for accounts had a negative affect on the memory overhead because overhead for each account state increased slightly. This was expected, but due to complexity of the original work in #5128 it was better to leave any optimizations out of that PR.
We now need to bring back this optimization, but only for the internal representation. The actual interface and serialization should remain unchanged.
This is how efficient representation would look like:
data ConwayAccountState era
= CASNoDelegation
-- | Current balance of the account
{-# UNPACK #-} !(CompactForm Coin)
-- | Deposit amount that was left when staking credential was registered
{-# UNPACK #-} !(CompactForm Coin)
| CASStakePool
-- | Current balance of the account
{-# UNPACK #-} !(CompactForm Coin)
-- | Deposit amount that was left when staking credential was registered
{-# UNPACK #-} !(CompactForm Coin)
-- | Delegation to a stake pool
!(KeyHash StakePool)
| CASDRep
-- | Current balance of the account
{-# UNPACK #-} !(CompactForm Coin)
-- | Deposit amount that was left when staking credential was registered
{-# UNPACK #-} !(CompactForm Coin)
-- | Delegation to a DRep
!DRep
| CASStakePoolAndDRep
-- | Current balance of the account
{-# UNPACK #-} !(CompactForm Coin)
{-# UNPACK #-} !(CompactForm Coin)
-- | Delegation to a stake pool
-- ^ Deposit amount that was left when staking credential was registered
!(KeyHash StakePool)
-- | Delegation to a DRep
!DRep
deriving (Show, Eq, Generic)Note - We don't need to do this optimization for prior eras, only the current Conway era needs it.
Metadata
Metadata
Assignees
Labels
maintenanceTasks that are planned to be done as part of the regular maintenance of the project.Tasks that are planned to be done as part of the regular maintenance of the project.
Type
Projects
Status
Done