You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When records are in state, in each transaction the FCQ of the payer account in the FCM receives an ExpirableTxnRecord. The first transaction in each second of consensus time will trigger the expiration of all the records added 180 seconds earlier.
Both adding and expiring records are done through the HederaLedger, which provides transactional semantics for a change-set against the accounts FCM. This provides atomicity for the business logic of a user transaction, so that if an unexpected problem occurs, we do not make an inconsistent change to the state.
However, there is no real benefit to including record creation and expiration in this transaction; and it incurs extra performance costs.
For creation, inject the ExpiringCreations with a supplier for the accounts FCM and modify the payer account with its new record directly in createExpiringRecord.
For expiration, inject the ExpiryManager with a supplier for the accounts FCM and modify the accounts with expiring records directly in purgeExpiredRecords().
The text was updated successfully, but these errors were encountered:
Summary
When records are in state, in each transaction the FCQ of the payer account in the FCM receives an
ExpirableTxnRecord
. The first transaction in each second of consensus time will trigger the expiration of all the records added 180 seconds earlier.Both adding and expiring records are done through the
HederaLedger
, which provides transactional semantics for a change-set against theaccounts
FCM. This provides atomicity for the business logic of a user transaction, so that if an unexpected problem occurs, we do not make an inconsistent change to the state.However, there is no real benefit to including record creation and expiration in this transaction; and it incurs extra performance costs.
Suggested resolution
Instead of changing account FCQs through the proxied
AccountProperty.RECORDS
getter/setter combination, we can:ExpiringCreations
with a supplier for theaccounts
FCM and modify the payer account with its new record directly increateExpiringRecord
.ExpiryManager
with a supplier for theaccounts
FCM and modify the accounts with expiring records directly inpurgeExpiredRecords()
.The text was updated successfully, but these errors were encountered: