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

fix: sync from genesis #114

Merged
merged 1 commit into from
Jun 1, 2023
Merged

Conversation

setunapo
Copy link
Collaborator

@setunapo setunapo commented Jun 1, 2023

Description

It fixes issue:Fail to sync from genesis block
The fix is in another repo: node-real/bsc-erigon-lib#11
Here is the code, will hit evm.chainRules.IsIstanbul: at early blocks, need to make IsParlia to use the right precompiles.

func (evm *EVM) precompile(addr libcommon.Address) (PrecompiledContract, bool) {
	var precompiles map[libcommon.Address]PrecompiledContract
	switch {
	case evm.chainRules.IsPlato:
		precompiles = PrecompiledContractsPlato
	case evm.chainRules.IsLuban:
		precompiles = PrecompiledContractsLuban
	case evm.chainRules.IsPlanck:
		precompiles = PrecompiledContractsPlanck
	case evm.chainRules.IsMoran:
		precompiles = PrecompiledContractsIsMoran
	case evm.chainRules.IsNano:
		precompiles = PrecompiledContractsNano
	case evm.chainRules.IsBerlin:
		precompiles = PrecompiledContractsBerlin
	case evm.chainRules.IsIstanbul:
		if evm.chainRules.IsParlia {
			precompiles = PrecompiledContractsIstanbulForBSC
		} else {
			precompiles = PrecompiledContractsIstanbul
		}
...
}

@calmbeing calmbeing merged commit 27caf6e into node-real:devel Jun 1, 2023
1 of 5 checks passed
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.

None yet

2 participants