Skip to content

refactor(gastime): remove hooks import#304

Open
alarso16 wants to merge 4 commits into
mainfrom
alarso16/gastime-hook-imports
Open

refactor(gastime): remove hooks import#304
alarso16 wants to merge 4 commits into
mainfrom
alarso16/gastime-hook-imports

Conversation

@alarso16
Copy link
Copy Markdown
Contributor

Removing the hooks imports in gastime makes its implementation more intuitive, and not depend on block headers. The naming may now be somewhat overkill. The motivation is to be able to provide the gastime into BuildBlock to add the minimum necessary data for state sync through this hook simply, rather than providing a custom type that takes in:

  • Excess
  • Seconds
  • Fraction

@alarso16 alarso16 force-pushed the alarso16/gastime-hook-imports branch from f27436e to e067216 Compare March 30, 2026 21:38
Comment thread hook/hook.go
// MinimumGasConsumption MUST be used as the implementation for the respective
// method on [params.RulesHooks]. The concrete type implementing the hooks MUST
// propagate incoming and return arguments unchanged.
func MinimumGasConsumption(txLimit uint64) uint64 {
Copy link
Copy Markdown
Contributor Author

@alarso16 alarso16 Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of scope - but I initially moved this and didn't even notice. What's the point of this function? It's unused

@alarso16 alarso16 marked this pull request as ready for review March 30, 2026 21:42
Comment thread gastime/gastime.go Outdated
Comment thread gastime/acp176.go
Comment thread blocks/execution_test.go
Copy link
Copy Markdown
Contributor

@JonathanOppenheimer JonathanOppenheimer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems straightforward enough to me.

Comment thread types/types.go
Comment on lines +51 to +54
var (
errTargetToExcessScalingZero = errors.New("targetToExcessScaling must be non-zero")
errMinPriceZero = errors.New("minPrice must be non-zero")
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move the var block at the top of the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants