Skip to content

Commit

Permalink
Fix GetBlockIDAtHeight error (ava-labs#1946)
Browse files Browse the repository at this point in the history
Co-authored-by: Darioush Jalali <[email protected]>
Co-authored-by: Aaron Buchwald <[email protected]>
  • Loading branch information
3 people authored Sep 6, 2022
1 parent 2b97a83 commit e11d47c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/Microsoft/go-winio v0.5.2
github.com/NYTimes/gziphandler v1.1.1
github.com/ava-labs/avalanche-network-runner-sdk v0.1.0
github.com/ava-labs/coreth v0.9.0-rc.4
github.com/ava-labs/coreth v0.9.0-rc.6
github.com/btcsuite/btcd v0.23.1
github.com/btcsuite/btcd/btcutil v1.1.1
github.com/decred/dcrd/dcrec/secp256k1/v3 v3.0.0-20200627015759-01fd2de07837
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/ava-labs/avalanche-network-runner-sdk v0.1.0 h1:m35SkmT7OO0cxrnqHCtQ0v8BHsDw8EZmo+yjH0DTqIs=
github.com/ava-labs/avalanche-network-runner-sdk v0.1.0/go.mod h1:1oDcmKg7Ed2QN3uxl6r5FqMsZMSAsGVBtI4ra0ewW/A=
github.com/ava-labs/coreth v0.9.0-rc.4 h1:lqLI1mqS+bG7gGSJ+ymIkpyczn2AipPMbHQGsYDWnUM=
github.com/ava-labs/coreth v0.9.0-rc.4/go.mod h1:0JhSjgFkdgxexhhY+hE2s8XmtF273jzm5ZgIifq0o5g=
github.com/ava-labs/coreth v0.9.0-rc.6 h1:fCh3lAHHsV9OFp1cDpOjJduX70MEnBQ9GhGDOmTmPts=
github.com/ava-labs/coreth v0.9.0-rc.6/go.mod h1:TCUPN8PjyzwOTtH9VsxAVcd8eMh8jcbFgz4a5DOx1Ug=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
Expand Down
2 changes: 1 addition & 1 deletion scripts/versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

# Set up the versions to be used
# Don't export them as their used in the context of other calls
coreth_version=${CORETH_VERSION:-'v0.9.0-rc.4'}
coreth_version=${CORETH_VERSION:-'v0.9.0-rc.6'}
9 changes: 7 additions & 2 deletions snow/engine/snowman/block/height_indexed_vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ type HeightIndexedChainVM interface {
// index.
VerifyHeightIndex() error

// GetBlockIDAtHeight returns the ID of the block that was accepted with
// [height].
// GetBlockIDAtHeight returns:
// - The ID of the block that was accepted with [height].
// - database.ErrNotFound if the [height] index is unknown.
//
// Note: A returned value of [database.ErrNotFound] typically means that the
// underlying VM was state synced and does not have access to the
// blockID at [height].
GetBlockIDAtHeight(height uint64) (ids.ID, error)
}
2 changes: 1 addition & 1 deletion version/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var (
Current = &Semantic{
Major: 1,
Minor: 8,
Patch: 1,
Patch: 2,
}
CurrentApp = &Application{
Major: Current.Major,
Expand Down
2 changes: 1 addition & 1 deletion vms/components/chain/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func produceGetStatus(s *State, getBlockIDAtHeight func(uint64) (ids.ID, error))
internalBlk.SetStatus(choices.Processing)
return choices.Processing, nil
default:
return choices.Unknown, fmt.Errorf("failed to get accepted blkID at height %d", blkHeight)
return choices.Unknown, fmt.Errorf("%w: failed to get accepted blkID at height %d", err, blkHeight)
}
}
}
Expand Down

0 comments on commit e11d47c

Please sign in to comment.