@@ -151,7 +151,7 @@ func TestValidation(t *testing.T) {
151151
152152 // Local is mainnet Petersburg, remote announces Byzantium + knowledge about Petersburg. Remote
153153 // is simply out of sync, accept.
154- {7987396 , ID {Hash : checksumToBytes (0x668db0af ), Next : 7280000 }, nil },
154+ {7987396 , ID {Hash : checksumToBytes (0xa00bc324 ), Next : 7280000 }, nil },
155155
156156 // Local is mainnet Petersburg, remote announces Spurious + knowledge about Byzantium. Remote
157157 // is definitely out of sync. It may or may not need the Petersburg update, we don't know yet.
@@ -178,6 +178,16 @@ func TestValidation(t *testing.T) {
178178
179179 // Local is mainnet Petersburg, remote is Rinkeby Petersburg.
180180 {7987396 , ID {Hash : checksumToBytes (0xafec6b27 ), Next : 0 }, ErrLocalIncompatibleOrStale },
181+
182+ // Local is mainnet Petersburg, far in the future. Remote announces Gopherium (non existing fork)
183+ // at some future block 88888888, for itself, but past block for local. Local is incompatible.
184+ //
185+ // This case detects non-upgraded nodes with majority hash power (typical Ropsten mess).
186+ {88888888 , ID {Hash : checksumToBytes (0x668db0af ), Next : 88888888 }, ErrLocalIncompatibleOrStale },
187+
188+ // Local is mainnet Byzantium. Remote is also in Byzantium, but announces Gopherium (non existing
189+ // fork) at block 7279999, before Petersburg. Local is incompatible.
190+ {7279999 , ID {Hash : checksumToBytes (0xa00bc324 ), Next : 7279999 }, ErrLocalIncompatibleOrStale },
181191 }
182192 for i , tt := range tests {
183193 filter := newFilter (params .MainnetChainConfig , params .MainnetGenesisHash , func () uint64 { return tt .head })
0 commit comments