Page MenuHomePhabricator

Use a different address in Avalanche test to prevent duplicate blocks
ClosedPublic

Authored by jasonbcox on Apr 9 2020, 17:37.

Details

Summary

regtest blocks are relatively deterministic, so generating a block with the
same height, coinbase, timestamp, etc. may coincide with a block that was already generated.
In this case, it's possible to coincide with a block that was invalidated using the same
coinbase address above this line.

Test Plan
test_runner.py abc-p2p-avalanche

Run this many times. On master, it's encountered ~10% of the time.
With this patch, we should not encounter it.

Note that abc-p2p-avalanche is still broken on master.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fabien added inline comments.
test/functional/abc-p2p-avalanche.py
177 ↗(On Diff #18709)

There is feature for that: fork_node.get_deterministic_priv_key().address

Use get_deterministic_priv_key instead, as fork_node's deterministic key won't collide with node's

This revision is now accepted and ready to land.Apr 9 2020, 18:06
deadalnix requested changes to this revision.Apr 9 2020, 18:13
deadalnix added a subscriber: deadalnix.
deadalnix added inline comments.
test/functional/abc-p2p-avalanche.py
84 ↗(On Diff #18710)

here

176 ↗(On Diff #18710)

Don't override the address variable.

This revision now requires changes to proceed.Apr 9 2020, 18:13

Fixed overwriting the address variable. These are expected to be re-used in the future, so I
will not remove those variables outright.

This revision is now accepted and ready to land.Apr 9 2020, 20:51