Skip to content

Add a type for modeling multiple-dimensional gas #482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions arbitrum/multigas/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Package multigas defines multi-dimensional gas for the EVM.
//
// This package introduces mechanisms to track each resource used by the EVM separately. The
// possible resources are computation, history growth, storage access, and storage growth. By
// tracking each one individually and setting specific constraints, we can increase the overall gas
// target for the chain.
package multigas
16 changes: 16 additions & 0 deletions arbitrum/multigas/resources.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package multigas

// ResourceKind represents a dimension for the multi-dimensional gas.
type ResourceKind uint8

const (
ResourceKindUnknown ResourceKind = iota
ResourceKindComputation
ResourceKindHistoryGrowth
ResourceKindStorageAccess
ResourceKindStorageGrowth
NumResourceKind
)

// MultiGas tracks gas for each resource separately.
type MultiGas [NumResourceKind]uint64
Loading