Green the 8 post-bump test failures (real fixes, no delete-to-hide)

- spending.go: harden spendingTx.Bytes() against nil msg (uninitialized tx no
  longer panics the spend-verification path; production always sets msg).
- config/genesis-builder tests: codec-era Codec.Marshal -> native g.Bytes();
  AddValidator field access -> methods (Weight()/Validator()/StakeOuts());
  drop unused pchaintxs imports.
- config test: consensus params K=30 alpha 16->20/25 to satisfy v1.36's tighter
  BFT bound (2*alpha-K >= floor((K-1)/3)+1); assertions updated.
- version/compatibility.json: register Current v1.32.11 under RPCChainVM proto 42
  (pre-existing registration gap).
- cevm e2e: genesis fixture completed with gasLimit+difficulty (strict geth
  genesis validation in the installed CEvm plugin; pre-existing fixture drift).

Co-authored-by: Hanzo Dev <dev@hanzo.ai>
This commit is contained in:
zeekay
2026-07-10 21:20:17 -07:00
co-authored by Hanzo Dev
parent 9626ca6c2f
commit c5e999487c
7 changed files with 29 additions and 25 deletions
+5 -6
View File
@@ -24,7 +24,6 @@ import (
"github.com/luxfi/node/genesis/builder"
"github.com/luxfi/node/nets"
pchaingenesis "github.com/luxfi/node/vms/platformvm/genesis"
pchaintxs "github.com/luxfi/node/vms/platformvm/txs"
)
const chainConfigFilenameExtension = ".ex"
@@ -536,8 +535,8 @@ func TestGetNetConfigsFromFlags(t *testing.T) {
"2Ctt6eGAeo4MLqTmGa7AdRecuVMPGWEX9wSsCLBYrLhX4a394i": {
"consensusParameters": {
"k": 30,
"alphaPreference": 16,
"alphaConfidence": 20
"alphaPreference": 20,
"alphaConfidence": 25
},
"validatorOnly": true
}
@@ -547,8 +546,8 @@ func TestGetNetConfigsFromFlags(t *testing.T) {
config, ok := given[id]
require.True(ok)
require.True(config.ValidatorOnly)
require.Equal(16, config.ConsensusParameters.AlphaPreference)
require.Equal(20, config.ConsensusParameters.AlphaConfidence)
require.Equal(20, config.ConsensusParameters.AlphaPreference)
require.Equal(25, config.ConsensusParameters.AlphaConfidence)
require.Equal(30, config.ConsensusParameters.K)
// must still respect defaults (MainnetParameters.MaxOutstandingItems = 1024)
require.Equal(1024, config.ConsensusParameters.MaxOutstandingItems)
@@ -733,7 +732,7 @@ func TestResolveUTXOAssetID_POnlyFallback(t *testing.T) {
require := require.New(t)
pOnly := &pchaingenesis.Genesis{Chains: nil}
pOnlyBytes, err := pchaingenesis.Codec.Marshal(pchaintxs.CodecVersion, pOnly)
pOnlyBytes, err := pOnly.Bytes()
require.NoError(err)
gotID, err := resolveUTXOAssetID(42, pOnlyBytes)
+2 -3
View File
@@ -11,7 +11,6 @@ import (
"github.com/stretchr/testify/require"
"github.com/luxfi/node/vms/platformvm/genesis"
pchaintxs "github.com/luxfi/node/vms/platformvm/txs"
)
// TestUTXOAssetIDFromGenesisBytes_Sovereign asserts the canonical
@@ -63,7 +62,7 @@ func TestUTXOAssetIDFromGenesisBytes_POnly(t *testing.T) {
require := require.New(t)
pOnly := &genesis.Genesis{Chains: nil}
pOnlyBytes, err := genesis.Codec.Marshal(pchaintxs.CodecVersion, pOnly)
pOnlyBytes, err := pOnly.Bytes()
require.NoError(err)
id, ok, err := UTXOAssetIDFromGenesisBytes(pOnlyBytes)
@@ -93,7 +92,7 @@ func TestVMGenesisOptInChains(t *testing.T) {
pOnly := &genesis.Genesis{
Chains: nil,
}
pOnlyBytes, err := genesis.Codec.Marshal(pchaintxs.CodecVersion, pOnly)
pOnlyBytes, err := pOnly.Bytes()
require.NoError(err)
for name, vmID := range map[string]ids.ID{
+10 -10
View File
@@ -314,15 +314,15 @@ func TestFromConfigExplicitStakers(t *testing.T) {
for i, vdrTx := range parsed.Validators {
switch ut := vdrTx.Unsigned.(type) {
case *txs.AddValidatorTx:
require.Equal(stakers[i].Weight, ut.Wght,
require.Equal(stakers[i].Weight, ut.Weight(),
"validator %d weight mismatch", i)
t.Logf("Validator %d: NodeID=%s Weight=%d StakeOuts=%d",
i, ut.Validator.NodeID, ut.Wght, len(ut.StakeOuts))
i, ut.Validator().NodeID, ut.Weight(), len(ut.StakeOuts()))
case *txs.AddPermissionlessValidatorTx:
require.Equal(stakers[i].Weight, ut.Wght,
require.Equal(stakers[i].Weight, ut.Weight(),
"validator %d weight mismatch", i)
t.Logf("Validator %d: NodeID=%s Weight=%d StakeOuts=%d",
i, ut.Validator.NodeID, ut.Wght, len(ut.StakeOuts))
i, ut.Validator().NodeID, ut.Weight(), len(ut.StakeOuts()))
default:
t.Fatalf("unexpected validator tx type: %T", ut)
}
@@ -396,15 +396,15 @@ func TestFromConfigExplicitStakersNoStakedFunds(t *testing.T) {
for i, vdrTx := range parsed.Validators {
switch ut := vdrTx.Unsigned.(type) {
case *txs.AddValidatorTx:
require.Greater(ut.Wght, uint64(0), "validator %d weight must be non-zero", i)
require.Greater(len(ut.StakeOuts), 0, "validator %d must have stake outputs", i)
require.Greater(ut.Weight(), uint64(0), "validator %d weight must be non-zero", i)
require.Greater(len(ut.StakeOuts()), 0, "validator %d must have stake outputs", i)
t.Logf("Validator %d: NodeID=%s Weight=%d StakeOuts=%d",
i, ut.Validator.NodeID, ut.Wght, len(ut.StakeOuts))
i, ut.Validator().NodeID, ut.Weight(), len(ut.StakeOuts()))
case *txs.AddPermissionlessValidatorTx:
require.Greater(ut.Wght, uint64(0), "validator %d weight must be non-zero", i)
require.Greater(len(ut.StakeOuts), 0, "validator %d must have stake outputs", i)
require.Greater(ut.Weight(), uint64(0), "validator %d weight must be non-zero", i)
require.Greater(len(ut.StakeOuts()), 0, "validator %d must have stake outputs", i)
t.Logf("Validator %d: NodeID=%s Weight=%d StakeOuts=%d",
i, ut.Validator.NodeID, ut.Wght, len(ut.StakeOuts))
i, ut.Validator().NodeID, ut.Weight(), len(ut.StakeOuts()))
default:
t.Fatalf("unexpected validator tx type: %T", ut)
}
+3 -3
View File
@@ -54,10 +54,10 @@ func TestZZZ_GateProbe_PerChainDigest(t *testing.T) {
rows := make([]row, 0, len(gen.Chains))
for _, c := range gen.Chains {
u := c.Unsigned.(*pchaintxs.CreateChainTx)
sum := sha256.Sum256(u.GenesisData)
sum := sha256.Sum256(u.GenesisData())
rows = append(rows, row{
name: u.BlockchainName,
vmid: u.VMID.String(),
name: u.BlockchainName(),
vmid: u.VMID().String(),
dataSum: hex.EncodeToString(sum[:]),
chainID: c.ID().String(),
})
+2 -1
View File
@@ -63,7 +63,8 @@
"v1.30.3",
"v1.30.4",
"v1.30.5",
"v1.30.6"
"v1.30.6",
"v1.32.11"
],
"41": [
"v1.13.2"
+6 -1
View File
@@ -42,7 +42,12 @@ type spendingTx struct {
msg *zap.Message
}
func (t spendingTx) Bytes() []byte { return t.msg.Bytes() }
func (t spendingTx) Bytes() []byte {
if t.msg == nil { // uninitialized tx (never Parsed/New*Tx'd) has no wire bytes
return nil
}
return t.msg.Bytes()
}
func (t *spendingTx) SetBytes(b []byte) { t.msg, _ = zap.Parse(b) }
func (t spendingTx) root() zap.Object { return t.msg.Root() }
+1 -1
View File
@@ -175,7 +175,7 @@ func TestCEvm_DialsZAPdbServer(t *testing.T) {
CChainID: make([]byte, 32),
UTXOAssetID: make([]byte, 32),
ChainDataDir: tmpDir,
GenesisBytes: []byte(`{"config":{"chainId":96369},"alloc":{}}`),
GenesisBytes: []byte(`{"config":{"chainId":96369},"gasLimit":"0x1312d00","difficulty":"0x0","alloc":{}}`),
UpgradeBytes: nil,
ConfigBytes: nil,
DBServerAddr: dbAddr,