-
Notifications
You must be signed in to change notification settings - Fork 238
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
Added compatibility tracking #334
Conversation
utils/compatibility_test.go
Outdated
func TestCompatibility(t *testing.T) { | ||
subevmVersion := "v0.4.0" | ||
expectedRPCVersion := 17 | ||
|
||
compat, err := os.ReadFile("../compatibility.json") | ||
assert.NoError(t, err) | ||
|
||
var parsedCompat rpcChainCompatibility | ||
err = json.Unmarshal(compat, &parsedCompat) | ||
assert.NoError(t, err) | ||
assert.Equal(t, expectedRPCVersion, parsedCompat.RPCChainVMProtocolVersion[subevmVersion]) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move this test to plugin/evm/version_test.go
and use the actual version and actual imported rpcchainvm.ProtocolVersion
from AvalancheGo, so that if we mess this up for the latest version this. test will fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a test, for it to work tho you will need to remember to update the version in plugins/evm/version.go
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the goal 😉
utils/compatibility_test.go
Outdated
subevmVersion := "v0.4.0" | ||
expectedRPCVersion := 17 | ||
|
||
compat, err := os.ReadFile("../compatibility.json") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use JSON embed here? For example: https://github.com/ava-labs/coreth/blob/master/plugin/evm/ext_data_hashes.go#L11-L13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go:embed
only works with files in a subdirectory of the test. I don't think we want to bury this json file in subdirectories, so I'm not going to make this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this up, could you make two small changes and then I think this should be good to merge and will make sure that we do not accidentally break this in the future.
plugin/evm/version_test.go
Outdated
_, valueInJSON := parsedCompat.RPCChainVMProtocolVersion[Version] | ||
assert.True(t, valueInJSON) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should assert that the actual value matches the rpcchainvm protocol version that we have imported from avalanchego as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks for putting this up 🙌
cmd/simulator/go.mod
Outdated
@@ -15,7 +15,7 @@ replace github.com/ava-labs/subnet-evm => ../.. | |||
|
|||
require ( | |||
github.com/VictoriaMetrics/fastcache v1.10.0 // indirect | |||
github.com/ava-labs/avalanchego v1.9.1 // indirect | |||
github.com/ava-labs/avalanchego v1.9.2-rc.7 // indirect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove rc
* Added compatibility tracking * Added version moved test * Cleaned up test * Bump avalanchego version and nits * go mod tidy cmd/simulator * Mark trie clean jouranl test as flaky * Bump avalanchego to v1.9.2 * Bump anr version in scripts/versions.sh * Bump anr version in go.mod * go mod tidy cmd/simulator Co-authored-by: Aaron Buchwald <[email protected]>
* drop outbound gossip requests for non validators * nit * nit
* Drop outbound gossip requests for non-validators (#334) * drop outbound gossip requests for non validators * nit * nit * sync changes --------- Co-authored-by: Joshua Kim <[email protected]>
* Add SDK Router message handling (#316) Co-authored-by: Stephen Buttolph <[email protected]> * Fix hanging requests after Shutdown (#326) * fix requests hanging after shutdown * fix build --------- Signed-off-by: Stephen Buttolph <[email protected]> Co-authored-by: Stephen Buttolph <[email protected]> * Update to 1.10.10-rc.2 (#328) * update to avalanchego 1.10.10-rc.2 * nits * nit * Add P2P SDK Pull Gossip (#318) * add batchsize * sync changes * Drop outbound gossip for non vdrs (#862) * Drop outbound gossip requests for non-validators (#334) * drop outbound gossip requests for non validators * nit * nit * sync changes --------- Co-authored-by: Joshua Kim <[email protected]> --------- Co-authored-by: Joshua Kim <[email protected]>
Added a
compatibility.json
similar to the one being added in avalanchego. Will allow external apps to determine which version of avalanchego to use without needing to parse the readme. Also added a test to make sure the json parses.This file will need to be updated with each new subnet-evm release.