Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

Discard storage items under Ethereum pallet #19

Closed
Tracked by #9
boundless-forest opened this issue Oct 20, 2022 · 0 comments · Fixed by #121
Closed
Tracked by #9

Discard storage items under Ethereum pallet #19

boundless-forest opened this issue Oct 20, 2022 · 0 comments · Fixed by #121

Comments

@boundless-forest
Copy link
Member

If we set up a new chain starting from 0, then most of the storage items in the Ethereum pallet seem useless.

Pending, CurrentBlock, CurrentReceipts, CurrentTransactionStatuses, and BlockHash are used to store the generated Ethereum-style Block, Transaction, and Receipt. Once the new chain starts, these storage items will be replaced with new data.

RemainingRingBalance and RemainingKtonBalance are also useless after the decimal update.

#[pallet::storage]
pub(super) type Pending<T: Config> = StorageValue<_, Vec<(Transaction, TransactionStatus, Receipt)>, ValueQuery>;

#[pallet::storage]
pub(super) type CurrentBlock<T: Config> = StorageValue<_, ethereum::BlockV2>;


#[pallet::storage]
pub(super) type CurrentReceipts<T: Config> = StorageValue<_, Vec<Receipt>>;


#[pallet::storage]
pub(super) type CurrentTransactionStatuses<T: Config> = StorageValue<_, Vec<TransactionStatus>>;


#[pallet::storage]
pub(super) type BlockHash<T: Config> = StorageMap<_, Twox64Concat, U256, H256, ValueQuery>;


#[pallet::storage]
#[pallet::getter(fn get_ring_remaining_balances)]
pub(super) type RemainingRingBalance<T: Config> =
	StorageMap<_, Blake2_128Concat, T::AccountId, u128, ValueQuery>;


#[pallet::storage]
#[pallet::getter(fn get_kton_remaining_balances)]
pub(super) type RemainingKtonBalance<T: Config> =
	StorageMap<_, Blake2_128Concat, T::AccountId, u128, ValueQuery>;
@boundless-forest boundless-forest mentioned this issue Oct 20, 2022
38 tasks
@boundless-forest boundless-forest linked a pull request Dec 12, 2022 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant