mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-03 22:33:06 +00:00
* Add segments and global metadata * Add journal asm files * Start revert * Revert access lists * Revert balance transfer * Revert code change * Revert nonce change * Revert storage change * Checkpoints * Add some journal entries * Add some journal entries * Add some journal entries * Fix revert * Checkpoint in sys_call * Minor * PR feedback * More checkpoints * Fix checkpoint check * Minor * Checkpoints in precompiles * Storage change checkpoint * Add touched addresses * Add touched addresses revert * Add touched addresses journal events * Delete all empty touch addresses * Implement selfdestruct * Update aggregator.rs
44 lines
1.4 KiB
Rust
44 lines
1.4 KiB
Rust
#[allow(dead_code)]
|
|
#[derive(Copy, Clone, Eq, PartialEq, Hash, Ord, PartialOrd, Debug)]
|
|
pub(crate) enum JournalEntry {
|
|
AccountLoaded = 0,
|
|
AccountDestroyed = 1,
|
|
AccountTouched = 2,
|
|
BalanceTransfer = 3,
|
|
NonceChange = 4,
|
|
StorageChange = 5,
|
|
StorageLoaded = 6,
|
|
CodeChange = 7,
|
|
}
|
|
|
|
impl JournalEntry {
|
|
pub(crate) const COUNT: usize = 8;
|
|
|
|
pub(crate) fn all() -> [Self; Self::COUNT] {
|
|
[
|
|
Self::AccountLoaded,
|
|
Self::AccountDestroyed,
|
|
Self::AccountTouched,
|
|
Self::BalanceTransfer,
|
|
Self::NonceChange,
|
|
Self::StorageChange,
|
|
Self::StorageLoaded,
|
|
Self::CodeChange,
|
|
]
|
|
}
|
|
|
|
/// The variable name that gets passed into kernel assembly code.
|
|
pub(crate) fn var_name(&self) -> &'static str {
|
|
match self {
|
|
Self::AccountLoaded => "JOURNAL_ENTRY_ACCOUNT_LOADED",
|
|
Self::AccountDestroyed => "JOURNAL_ENTRY_ACCOUNT_DESTROYED",
|
|
Self::AccountTouched => "JOURNAL_ENTRY_ACCOUNT_TOUCHED",
|
|
Self::BalanceTransfer => "JOURNAL_ENTRY_BALANCE_TRANSFER",
|
|
Self::NonceChange => "JOURNAL_ENTRY_NONCE_CHANGE",
|
|
Self::StorageChange => "JOURNAL_ENTRY_STORAGE_CHANGE",
|
|
Self::StorageLoaded => "JOURNAL_ENTRY_STORAGE_LOADED",
|
|
Self::CodeChange => "JOURNAL_ENTRY_CODE_CHANGE",
|
|
}
|
|
}
|
|
}
|