File tree Expand file tree Collapse file tree 8 files changed +20
-7
lines changed
config/src/forge_interface/deploy_gateway_ctm Expand file tree Collapse file tree 8 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ pub struct DeployGatewayCTMInput {
39
39
40
40
bootloader_hash : H256 ,
41
41
default_aa_hash : H256 ,
42
+ evm_emulator_hash : Option < H256 > ,
42
43
43
44
priority_tx_max_gas_limit : u64 ,
44
45
@@ -109,6 +110,7 @@ impl DeployGatewayCTMInput {
109
110
110
111
bootloader_hash : genesis_input. bootloader_hash ,
111
112
default_aa_hash : genesis_input. default_aa_hash ,
113
+ evm_emulator_hash : genesis_input. evm_emulator_hash ,
112
114
113
115
priority_tx_max_gas_limit : initial_deployment_config. priority_tx_max_gas_limit ,
114
116
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ pub async fn init_configs(
49
49
chain_config : & ChainConfig ,
50
50
) -> anyhow:: Result < ContractsConfig > {
51
51
// Port scanner should run before copying configs to avoid marking initial ports as assigned
52
- let mut ecosystem_ports = EcosystemPortsScanner :: scan ( shell) ?;
52
+ let mut ecosystem_ports = EcosystemPortsScanner :: scan ( shell, Some ( & chain_config . name ) ) ?;
53
53
copy_configs ( shell, & ecosystem_config. link_to_code , & chain_config. configs ) ?;
54
54
55
55
if !init_args. no_port_reallocation {
Original file line number Diff line number Diff line change @@ -399,7 +399,7 @@ async fn await_for_tx_to_complete(
399
399
if receipt. status == Some ( U64 :: from ( 1 ) ) {
400
400
println ! ( "Transaction completed successfully!" ) ;
401
401
} else {
402
- panic ! ( "Transaction failed!" ) ;
402
+ panic ! ( "Transaction failed! Receipt: {:?}" , receipt ) ;
403
403
}
404
404
405
405
Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -17,9 +17,10 @@ pub(crate) async fn run(shell: &Shell) -> anyhow::Result<()> {
17
17
. load_chain ( Some ( ecosystem. current_chain ( ) . to_string ( ) ) )
18
18
. context ( MSG_CHAIN_NOT_FOUND_ERR ) ?;
19
19
let spinner = Spinner :: new ( MSG_GENESIS_FILE_GENERATION_STARTED ) ;
20
- let secrets_path = chain. path_to_secrets_config ( ) ;
20
+ let secrets_path = chain. path_to_secrets_config ( ) . canonicalize ( ) . unwrap ( ) ;
21
21
let dal = get_core_dal ( shell, None ) . await ?;
22
22
reset_database ( shell, ecosystem. link_to_code , dal) . await ?;
23
+ let _a = shell. push_dir ( "core" ) ;
23
24
Cmd :: new ( cmd ! ( shell, "cargo run --package genesis_generator --bin genesis_generator -- --config-path={secrets_path}" ) ) . run ( ) ?;
24
25
spinner. finish ( ) ;
25
26
Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ fn print_status(health_check_url: String) -> anyhow::Result<()> {
93
93
}
94
94
95
95
fn print_ports ( shell : & Shell ) -> anyhow:: Result < ( ) > {
96
- let ports = EcosystemPortsScanner :: scan ( shell) ?;
96
+ let ports = EcosystemPortsScanner :: scan ( shell, None ) ?;
97
97
let grouped_ports = ports. group_by_file_path ( ) ;
98
98
99
99
let mut all_port_lines: Vec < String > = Vec :: new ( ) ;
Original file line number Diff line number Diff line change @@ -28,14 +28,14 @@ pub(crate) async fn run(shell: &Shell) -> anyhow::Result<()> {
28
28
Some ( ref chain_name) => vec ! [ chain_name. clone( ) ] ,
29
29
None => ecosystem_config. list_of_chains ( ) ,
30
30
} ;
31
- let mut ports = EcosystemPortsScanner :: scan ( shell) ?;
32
31
// Initialize chains one by one
33
32
let mut explorer_config = ExplorerConfig :: read_or_create_default ( shell) ?;
34
33
for chain_name in chains_enabled. iter ( ) {
35
34
// Load chain config
36
35
let chain_config = ecosystem_config
37
36
. load_chain ( Some ( chain_name. clone ( ) ) )
38
37
. context ( msg_chain_load_err ( chain_name) ) ?;
38
+ let mut ports = EcosystemPortsScanner :: scan ( shell, Some ( & chain_config. name ) ) ?;
39
39
// Build backend config - parameters required to create explorer backend services
40
40
let backend_config = build_backend_config ( & mut ports, & chain_config) ?;
41
41
// Initialize explorer database
Original file line number Diff line number Diff line change @@ -50,7 +50,8 @@ async fn prepare_configs(
50
50
en_configs_path : & Path ,
51
51
args : PrepareConfigFinal ,
52
52
) -> anyhow:: Result < ( ) > {
53
- let mut ports = EcosystemPortsScanner :: scan ( shell) ?;
53
+ // Reallocating ports for en required to use the current chain ports as well
54
+ let mut ports = EcosystemPortsScanner :: scan ( shell, None ) ?;
54
55
let genesis = config. get_genesis_config ( ) . await ?;
55
56
let general = config. get_general_config ( ) . await ?;
56
57
let gateway = config. get_gateway_chain_config ( ) . ok ( ) ;
Original file line number Diff line number Diff line change @@ -205,7 +205,10 @@ pub struct EcosystemPortsScanner;
205
205
impl EcosystemPortsScanner {
206
206
/// Scans the ecosystem directory for YAML files and extracts port information.
207
207
/// Specifically, it looks for keys ending with "port" or "ports" and collects their values.
208
- pub fn scan ( shell : & Shell ) -> Result < EcosystemPorts > {
208
+ /// We could skip searching ports in the current chain if we initialize this chain.
209
+ /// It allows to reuse default ports even if the general file exist with previously allocated ports.
210
+ /// It makes allocation more predictable
211
+ pub fn scan ( shell : & Shell , current_chain : Option < & str > ) -> Result < EcosystemPorts > {
209
212
let ecosystem_config = EcosystemConfig :: from_file ( shell) ?;
210
213
211
214
// Create a list of directories to scan:
@@ -215,6 +218,12 @@ impl EcosystemPortsScanner {
215
218
// - Ecosystem directory (docker-compose files)
216
219
let mut dirs = vec ! [ ecosystem_config. config. clone( ) ] ;
217
220
for chain in ecosystem_config. list_of_chains ( ) {
221
+ // skip current chain for avoiding wrong reallocation
222
+ if let Some ( name) = current_chain {
223
+ if name. eq ( & chain) {
224
+ continue ;
225
+ }
226
+ }
218
227
if let Ok ( chain_config) = ecosystem_config. load_chain ( Some ( chain) ) {
219
228
dirs. push ( chain_config. configs . clone ( ) ) ;
220
229
if let Some ( external_node_config_path) = & chain_config. external_node_config_path {
You can’t perform that action at this time.
0 commit comments