Skip to content
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

imp(vm): define default JumpTable (backport #3) #13

Merged
merged 4 commits into from
Feb 1, 2023

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Jan 31, 2023

This is an automatic backport of pull request #3 done by Mergify.
Cherry-pick of 5ca9939 has failed:

On branch mergify/bp/release/1.10/pr-3
Your branch is up to date with 'origin/release/1.10'.

You are currently cherry-picking commit 5ca9939d2.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   CHANGELOG.md
	both modified:   core/vm/interpreter.go
	both modified:   core/vm/jump_table.go
	deleted by us:   core/vm/jump_table_test.go

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

(cherry picked from commit 5ca9939)

# Conflicts:
#	CHANGELOG.md
#	core/vm/interpreter.go
#	core/vm/jump_table.go
#	core/vm/jump_table_test.go
@mergify mergify bot added the conflicts label Jan 31, 2023
@facs95
Copy link

facs95 commented Jan 31, 2023

Fixed the conflicts on the interpreter.go file trying to maintain the logic that was there at that current state of the release branch. It is missing some logic that master has regarding the extraEips. If we want to include those changes the new NewEVMInterpreter should look like this:

// NewEVMInterpreter returns a new instance of the Interpreter.
func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter {
	// If jump table was not initialised we set the default one.
	if cfg.JumpTable == nil {
		cfg.JumpTable = DefaultJumpTable(evm.chainRules)
		var extraEips []int
		if len(cfg.ExtraEips) > 0 {
			// Deep-copy jumptable to prevent modification of opcodes in other tables
			cfg.JumpTable = CopyJumpTable(cfg.JumpTable)
		}
		for _, eip := range cfg.ExtraEips {
			if err := EnableEIP(eip, cfg.JumpTable); err != nil {
				// Disable it, so caller can check if it's activated or not
				log.Error("EIP activation failed", "eip", eip, "error", err)
			} else {
				extraEips = append(extraEips, eip)
			}
		}
		cfg.ExtraEips = extraEips
	}

	return &EVMInterpreter{
		evm: evm,
		cfg: cfg,
	}
}

@fedekunze fedekunze merged commit 9590b44 into release/1.10 Feb 1, 2023
@fedekunze fedekunze deleted the mergify/bp/release/1.10/pr-3 branch February 1, 2023 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants