Skip to content

feat: gas model stf#881

Open
TwEricShen wants to merge 2 commits into
847-feat-gas-model-080from
feat/gas_model_stf
Open

feat: gas model stf#881
TwEricShen wants to merge 2 commits into
847-feat-gas-model-080from
feat/gas_model_stf

Conversation

@TwEricShen

@TwEricShen TwEricShen commented Jan 10, 2026

Copy link
Copy Markdown
Contributor

implementation version: gas model

TODO: check the implementation is stick to the new 0.8.0 Graypaper gas model.

Testing

Once gas model is implemented, the implementation needs to be integrated with the test vectors.

@TwEricShen TwEricShen self-assigned this Jan 10, 2026
@TwEricShen TwEricShen requested a review from weigen393 January 10, 2026 15:02
@TwEricShen TwEricShen added the feat new feature for the user, not a new feature for build script label Jan 10, 2026
Comment thread PVM/gas_model_stf.go
func (b *BlockState) SimulatePipeline(program *Program, pc ProgramCounter) Gas {
for program.ValidateOpcode(pc); ; {
// Ξ'(n+1)
blockEnd := (b.Step != 0 && program.Bitmasks.IsStartOfInstruction(int(b.Iota)))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Some different with GP
Cannot implement ι ≠ ∅ , so check if ι is next block's start instruction

Comment thread PVM/gas_model_stf.go
targetPC := b.Iota
opcodeResource := getOpcodeResource(opcode(program.InstructionData[targetPC]))
// iota
b.Iota += ProgramCounter(skip(int(pc), program.Bitmasks)) + 1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ditto. Since cannot assign ∅ to ι, just update and check in the upper func. ι will not be returned.

I think this change might be reasonable.

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

Labels

feat new feature for the user, not a new feature for build script

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants