Skip to content

nano HF support for bsc - #24095

Open
sudeepdino008 wants to merge 5 commits into
moskud/bsc-sup/flag_range_sizefrom
moskud/bsc-sup/nano-hardfork-support
Open

sudeepdino008 wants to merge 5 commits into
moskud/bsc-sup/flag_range_sizefrom
moskud/bsc-sup/nano-hardfork-support

Conversation

@sudeepdino008

@sudeepdino008 sudeepdino008 commented Sep 17, 2026

Copy link
Copy Markdown
Member

two changes needed for Nano:

  1. blacklisted accounts
  • putting the check in Engine's ValidateBlockPostExecution. The check probably belongs pre-tx execution, but this method is "state root equivalent" and causes the expected block rejection. So I'm going with this.
  1. disabling the proof validation opcodes

stacked on: #24050

@AskAlexSharov

Copy link
Copy Markdown
Collaborator

bsc/parlia/parlia.go:L175-191: shrink: GetSender with a warn-and-continue branch, and two map lookups. tx.Sender recovers the sender when it is not cached, so the branch goes away:

for _, tx := range txns {
	sender, err := tx.Sender(*p.signer)
	if err != nil {
		return err
	}
	to := tx.GetTo()
	if slices.Contains(bscchain.NanoBlackList, sender.Value()) || (to != nil && slices.Contains(bscchain.NanoBlackList, *to)) {
		return errors.New("block blacklist account")
	}
}

bsc/chain/blacklist.go:L22-27: stdlib: map[common.Address]struct{} for 3 addresses. Keep the slice, slices.Contains covers it.
execution/vm/contracts_lightclient.go:L154-183: shrink: two stub types that differ only in gas and name. One type:

type suspendedPrecompile struct {
	gas  uint64
	name string
}

func (c *suspendedPrecompile) RequiredGas([]byte) uint64  { return c.gas }
func (c *suspendedPrecompile) Run([]byte) ([]byte, error) { return nil, errors.New("suspend") }
func (c *suspendedPrecompile) Name() string               { return c.name }

net: -28 lines possible.

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.

2 participants