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

Not All ReadSkeletonHeader check the return value equals nil #27931

Closed
lyciumlee opened this issue Aug 15, 2023 · 0 comments · Fixed by #27945
Closed

Not All ReadSkeletonHeader check the return value equals nil #27931

lyciumlee opened this issue Aug 15, 2023 · 0 comments · Fixed by #27945
Labels
Milestone

Comments

@lyciumlee
Copy link

System information

Geth version: geth version v1.12.2
CL client & version: e.g. lighthouse/nimbus/prysm@v1.0.0
OS & Version: Windows/Linux/OSX
Commit hash : (if develop)

Expected behaviour

ret := rawdb.ReadSkeletonHeader(x,xx)
we should check if ret == nil

Actual behaviour

	if lastchain.Tail >= number {
		// If the chain is down to a single beacon header, and it is re-announced
		// once more, ignore it instead of tearing down sync for a noop.
		if lastchain.Head == lastchain.Tail {
			if current := rawdb.ReadSkeletonHeader(s.db, number); current.Hash() == head.Hash() {
				return false
			}
if parent := rawdb.ReadSkeletonHeader(s.db, number-1); parent.Hash() != head.ParentHash {
	if force {
		log.Warn("Beacon chain forked", "ancestor", parent.Number, "hash", parent.Hash(), "want", head.ParentHash)
	}
	return true
}

Steps to reproduce the behaviour

Backtrace

[backtrace]

image

we should check the return value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants