mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-12-01 20:05:43 +03:00
Ms.rc8 changes (#1307)
* Migrate rc6,rc7 to rc8 * Fix migration and green flag issue * Testnet8 constants * testnet8 introducer * Remove comment * New test blocks
This commit is contained in:
parent
83ef5ee387
commit
10e5bc3ae3
@ -58,7 +58,7 @@ jobs:
|
||||
with:
|
||||
repository: 'Chia-Network/test-cache'
|
||||
path: '.chia'
|
||||
ref: '0.23.0'
|
||||
ref: '0.24.0'
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Link home directory
|
||||
|
2
.github/workflows/build-test-macos-core.yml
vendored
2
.github/workflows/build-test-macos-core.yml
vendored
@ -58,7 +58,7 @@ jobs:
|
||||
with:
|
||||
repository: 'Chia-Network/test-cache'
|
||||
path: '.chia'
|
||||
ref: '0.23.0'
|
||||
ref: '0.24.0'
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Link home directory
|
||||
|
@ -58,7 +58,7 @@ jobs:
|
||||
with:
|
||||
repository: 'Chia-Network/test-cache'
|
||||
path: '.chia'
|
||||
ref: '0.23.0'
|
||||
ref: '0.24.0'
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Link home directory
|
||||
|
@ -58,7 +58,7 @@ jobs:
|
||||
with:
|
||||
repository: 'Chia-Network/test-cache'
|
||||
path: '.chia'
|
||||
ref: '0.23.0'
|
||||
ref: '0.24.0'
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Link home directory
|
||||
|
@ -65,7 +65,7 @@ jobs:
|
||||
with:
|
||||
repository: 'Chia-Network/test-cache'
|
||||
path: '.chia'
|
||||
ref: '0.23.0'
|
||||
ref: '0.24.0'
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Link home directory
|
||||
|
2
.github/workflows/build-test-ubuntu-core.yml
vendored
2
.github/workflows/build-test-ubuntu-core.yml
vendored
@ -65,7 +65,7 @@ jobs:
|
||||
with:
|
||||
repository: 'Chia-Network/test-cache'
|
||||
path: '.chia'
|
||||
ref: '0.23.0'
|
||||
ref: '0.24.0'
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Link home directory
|
||||
|
@ -65,7 +65,7 @@ jobs:
|
||||
with:
|
||||
repository: 'Chia-Network/test-cache'
|
||||
path: '.chia'
|
||||
ref: '0.23.0'
|
||||
ref: '0.24.0'
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Link home directory
|
||||
|
@ -65,7 +65,7 @@ jobs:
|
||||
with:
|
||||
repository: 'Chia-Network/test-cache'
|
||||
path: '.chia'
|
||||
ref: '0.23.0'
|
||||
ref: '0.24.0'
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Link home directory
|
||||
|
@ -312,13 +312,6 @@ def chia_init(root_path: Path):
|
||||
)
|
||||
|
||||
print(f"Chia directory {root_path}")
|
||||
if root_path.is_dir() and Path(root_path / "config" / "config.yaml").exists():
|
||||
# This is reached if CHIA_ROOT is set, or if user has run chia init twice
|
||||
# before a new update.
|
||||
check_keys(root_path)
|
||||
|
||||
print(f"{root_path} already exists, no migration action taken")
|
||||
return -1
|
||||
|
||||
# These are the config keys that will not be migrated, and instead the default is used
|
||||
DO_NOT_MIGRATE_SETTINGS: List[str] = [
|
||||
@ -366,6 +359,12 @@ def chia_init(root_path: Path):
|
||||
"pool.xch_target_address",
|
||||
"ALERTS_URL",
|
||||
"CHIA_ALERTS_PUBKEY",
|
||||
"pool.xch_target_address",
|
||||
"full_node.xch_target_address",
|
||||
"farmer.farmer_target", # These were buggy values in rc7
|
||||
"farmer.pool_target", # These were buggy values in rc7
|
||||
"pool.pool_target", # These were buggy values in rc7
|
||||
"pool.farmer_target", # These were buggy values in rc7
|
||||
]
|
||||
|
||||
# These are the files that will be migrated
|
||||
@ -377,9 +376,28 @@ def chia_init(root_path: Path):
|
||||
|
||||
manifest = MANIFEST
|
||||
|
||||
# Starting with RC2 is the first version that used the bech32m addresses
|
||||
# range current version and 0=version 1
|
||||
# for version_number in range(chia_minor_release_number() - 1, 2, -1):
|
||||
if root_path.is_dir() and Path(root_path / "config" / "config.yaml").exists():
|
||||
# This is reached if CHIA_ROOT is set, or if user has run chia init twice
|
||||
# before a new update.
|
||||
config: Dict = load_config(root_path, "config.yaml")
|
||||
if config["selected_network"] != "testnet8":
|
||||
# Rc6, Rc7 -> Rc8 migration
|
||||
tmp_path = Path(os.path.expanduser(Path("~/.chia/testnet8-tmp")))
|
||||
if tmp_path.exists():
|
||||
shutil.rmtree(tmp_path)
|
||||
assert migrate_from(root_path, tmp_path, manifest, DO_NOT_MIGRATE_SETTINGS)
|
||||
check_keys(tmp_path)
|
||||
shutil.rmtree(root_path)
|
||||
tmp_path.rename(root_path)
|
||||
return 0
|
||||
else:
|
||||
check_keys(root_path)
|
||||
print(f"{root_path} already exists, no migration action taken")
|
||||
return -1
|
||||
|
||||
print(f"Checking {os.path.expanduser(Path('~/.chia/testnet'))}")
|
||||
|
||||
# Migrate only from rc2 and up. Target addresses are not migrated.
|
||||
for version_number in range(5, 2, -1):
|
||||
old_path = Path(os.path.expanduser("~/.chia/1.0rc%s" % version_number))
|
||||
print(f"Checking {old_path}")
|
||||
|
@ -11,13 +11,13 @@ testnet_kwargs = {
|
||||
"SUB_SLOT_ITERS_STARTING": 2 ** 27,
|
||||
# DIFFICULTY_STARTING is the starting difficulty for the first epoch, which is then further
|
||||
# multiplied by another factor of DIFFICULTY_CONSTANT_FACTOR, to be used in the VDF iter calculation formula.
|
||||
"DIFFICULTY_CONSTANT_FACTOR": 2 ** 62,
|
||||
"DIFFICULTY_CONSTANT_FACTOR": 2 ** 67,
|
||||
"DIFFICULTY_STARTING": 5,
|
||||
"DIFFICULTY_CHANGE_MAX_FACTOR": 3, # The next difficulty is truncated to range [prev / FACTOR, prev * FACTOR]
|
||||
# These 3 constants must be changed at the same time
|
||||
"SUB_EPOCH_BLOCKS": 384, # The number of blocks per sub-epoch, mainnet 384
|
||||
"EPOCH_BLOCKS": 384 * 4, # The number of blocks per epoch, mainnet 4608. Must be multiple of SUB_EPOCH_SB
|
||||
"SIGNIFICANT_BITS": 12, # The number of bits to look at in difficulty and min iters. The rest are zeroed
|
||||
"EPOCH_BLOCKS": 4608, # The number of blocks per epoch, mainnet 4608. Must be multiple of SUB_EPOCH_SB
|
||||
"SIGNIFICANT_BITS": 8, # The number of bits to look at in difficulty and min iters. The rest are zeroed
|
||||
"DISCRIMINANT_SIZE_BITS": 1024, # Max is 1024 (based on ClassGroupElement int size)
|
||||
"NUMBER_ZERO_BITS_PLOT_FILTER": 9, # H(plot signature of the challenge) must start with these many zeroes
|
||||
"MIN_PLOT_SIZE": 32, # 32 for mainnet
|
||||
@ -59,7 +59,7 @@ testnet_kwargs = {
|
||||
"BLOCKS_CACHE_SIZE": 4608 + (128 * 4),
|
||||
"WEIGHT_PROOF_RECENT_BLOCKS": 1000,
|
||||
"MAX_BLOCK_COUNT_PER_REQUESTS": 32, # Allow up to 32 blocks per request
|
||||
"INITIAL_FREEZE_PERIOD": 5000, # Transaction are disabled first 5000 blocks
|
||||
"INITIAL_FREEZE_PERIOD": 42 * 4608,
|
||||
"NETWORK_TYPE": 0,
|
||||
"MAX_GENERATOR_SIZE": 1000000,
|
||||
"MAX_GENERATOR_REF_LIST_SIZE": 10000, # Number of references allowed in the block generator ref list
|
||||
|
@ -55,6 +55,9 @@ async def fetch(url: str):
|
||||
ssl_context = ssl_context_for_root(mozzila_root)
|
||||
response = await session.get(url, ssl=ssl_context)
|
||||
await session.close()
|
||||
if not response.ok:
|
||||
log.warning("Response not OK.")
|
||||
return None
|
||||
return await response.text()
|
||||
except Exception as e:
|
||||
await session.close()
|
||||
@ -182,7 +185,9 @@ class WebSocketServer:
|
||||
|
||||
selected = self.net_config["selected_network"]
|
||||
alert_url = self.net_config["ALERTS_URL"]
|
||||
log.debug("Fetching alerts")
|
||||
response = await fetch(alert_url)
|
||||
log.debug(f"Fetched alert: {response}")
|
||||
if response is None:
|
||||
continue
|
||||
|
||||
|
@ -26,6 +26,13 @@ network_overrides: &network_overrides
|
||||
NETWORK_TYPE: 1
|
||||
GENESIS_PRE_FARM_POOL_PUZZLE_HASH: "70ac50c1faf71293113e7572e538234065ead0c193241256a620d6f52e06d86a"
|
||||
GENESIS_PRE_FARM_FARMER_PUZZLE_HASH: "9e6a07d5cbc019b2fdef559d7c7f8d2a80412546ad6e00c67a19bcdcacd32cab"
|
||||
testnet8:
|
||||
DIFFICULTY_CONSTANT_FACTOR: 36893488147419103232 # 2^65
|
||||
INITIAL_FREEZE_PERIOD: 3000
|
||||
GENESIS_CHALLENGE: null
|
||||
NETWORK_TYPE: 1
|
||||
GENESIS_PRE_FARM_POOL_PUZZLE_HASH: "70ac50c1faf71293113e7572e538234065ead0c193241256a620d6f52e06d86a"
|
||||
GENESIS_PRE_FARM_FARMER_PUZZLE_HASH: "9e6a07d5cbc019b2fdef559d7c7f8d2a80412546ad6e00c67a19bcdcacd32cab"
|
||||
config:
|
||||
mainnet:
|
||||
address_prefix: "xch"
|
||||
@ -35,9 +42,11 @@ network_overrides: &network_overrides
|
||||
address_prefix: "txch"
|
||||
testnet6:
|
||||
address_prefix: "txch"
|
||||
testnet8:
|
||||
address_prefix: "txch"
|
||||
|
||||
selected_network: &selected_network "testnet6"
|
||||
ALERTS_URL: https://download.chia.net/notify/testnet_6_alert.txt
|
||||
selected_network: &selected_network "testnet8"
|
||||
ALERTS_URL: https://download.chia.net/notify/testnet_8_alert.txt
|
||||
CHIA_ALERTS_PUBKEY: 89b7fd87cb56e926ecefb879a29aae308be01f31980569f6a75a69d2a9a69daefd71fb778d865f7c50d6c967e3025937
|
||||
|
||||
# public ssl ca is included in source code
|
||||
@ -194,9 +203,9 @@ full_node:
|
||||
port: 58444
|
||||
|
||||
# Run multiple nodes with different databases by changing the database_path
|
||||
database_path: db/blockchain_v30_CHALLENGE.sqlite
|
||||
database_path: db/blockchain_v1_CHALLENGE.sqlite
|
||||
peer_db_path: db/peer_table_node.sqlite
|
||||
simulator_database_path: sim_db/simulator_blockchain_v30_CHALLENGE.sqlite
|
||||
simulator_database_path: sim_db/simulator_blockchain_v1_CHALLENGE.sqlite
|
||||
simulator_peer_db_path: sim_db/peer_table_node.sqlite
|
||||
|
||||
# If True, starts an RPC server at the following port
|
||||
@ -238,7 +247,7 @@ full_node:
|
||||
host: *self_hostname
|
||||
port: 8446
|
||||
introducer_peer:
|
||||
host: introducer1.beta.chia.net # Chia AWS introducer IPv4/IPv6
|
||||
host: introducer.beta.chia.net # Chia AWS introducer IPv4/IPv6
|
||||
port: 58444
|
||||
wallet_peer:
|
||||
host: *self_hostname
|
||||
@ -306,7 +315,7 @@ wallet:
|
||||
port: 58444
|
||||
|
||||
testing: False
|
||||
database_path: wallet/db/blockchain_wallet_v30_CHALLENGE_KEY.sqlite
|
||||
database_path: wallet/db/blockchain_wallet_v1_CHALLENGE_KEY.sqlite
|
||||
wallet_peers_path: wallet/db/wallet_peers.sqlite
|
||||
|
||||
logging: *logging
|
||||
@ -320,7 +329,7 @@ wallet:
|
||||
recent_peer_threshold: 6000
|
||||
|
||||
introducer_peer:
|
||||
host: introducer1.beta.chia.net # Chia AWS introducer IPv4/IPv6
|
||||
host: introducer.beta.chia.net # Chia AWS introducer IPv4/IPv6
|
||||
port: 58444
|
||||
|
||||
ssl:
|
||||
|
Loading…
Reference in New Issue
Block a user