autonomys / subspace

Subspace Network reference implementation
https://subspace.network
384 stars 244 forks source link

`DomainGenesisBlockBuilder` does not add evm precompiles and const `chain_id` #1872

Closed vedhavyas closed 12 months ago

vedhavyas commented 1 year ago

Any Domains with out raw_genesis_config will not have precompiles enabled. Also noticed that chain_id is constant for all EVM domains. It needs to come from the runtime, maybe an incremental value 🤔

jfrank-summit commented 1 year ago

I don't think chain_id should be incremental as you may have collisions with existing non-subspace chain ids.

vedhavyas commented 1 year ago

I don't think chain_id should be incremental as you may have collisions with existing non-subspace chain ids.

Sure but the we would have to start tracking all the chain_ids that are already used outside subspace. Other option is to let user pick a chain_id. This also allows folks to pick an already exisiting one. So tracking known chain Id would be inevitable I think.

What is the main concern on collisions though? Ideally we would start at larger number like 1000, which should be outside of more prominent chain_ids

jfrank-summit commented 1 year ago

I think allowing the user to pick a chain_id makes the most sense, at least then they have the option of looking for potential collisions. This also allows them to pick a potentially meaningful id.