hirosystems / stacks-subnets

Stacks Subnets: a layer-2 scaling solution for Stacks, intended for high-throughput, low-latency workloads
http://docs.hiro.so
GNU General Public License v3.0
51 stars 13 forks source link

fix: use chain ID from config file #282

Closed obycode closed 1 year ago

obycode commented 1 year ago

Previously, the chain ID from the config file was ignored:

[node]
chain_id = 0x55005500

This now uses that chain ID, and also sets the default to this 0x55005500 to avoid accidentally matching the L1 chain ID by default.

obycode commented 1 year ago

Since there are going to be multiple subnets, do we want to make unlikely for different subnets to have the same chain ID? We could either generate a random default, or force users to set something in the config file.

Also, we may want to add an explicit check that the ID doesn't match any of the defined L1 IDs.

I like keeping a default value that can be overridden by a configuration option, but you're right, the explicit check is a good idea to make sure no one accidentally creates a subnet with transactions that are replayable on mainnet.