Skip to content

Commit

Permalink
add legacy account config and increase max fee, funds amt (#35)
Browse files Browse the repository at this point in the history
* add legacy account config and increase max fee, funds amt

* add katana config in readme

* format
  • Loading branch information
apoorvsadana authored Jan 9, 2024
1 parent d2246e5 commit caa6179
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ Cargo.lock

# Gatling reports directory
reports

# IntelliJ IDEA
.idea
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ RUST_LOG=debug cargo run -- shoot -c config/default.yaml
gatling --help
```

For Katana, currently you need to increase the `DEFAULT_PREFUNDED_ACCOUNT_BALANCE` in constants to `0xffffffffffffffffffffffffffffffff`
and run the node with flag `--no-validate`.

### Configuration

Gomu gomu's configuration is specified as a yaml file.
Expand Down
1 change: 1 addition & 0 deletions config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ deployer:
salt: "1"
address: "0x0000000000000000000000000000000000000000000000000000000000000004"
signing_key: "0x00c1cf1490de1352865301bb8705143f3ef938f97fdf892f1090dcb5ac7bcd1d"
legacy_account: false
1 change: 1 addition & 0 deletions config/katana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ deployer:
salt: "1"
address: "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"
signing_key: "0x1800000000300000180000000000030000000000003006001800006600"
legacy_account: true
10 changes: 7 additions & 3 deletions src/actions/shoot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use std::time::{Duration, SystemTime};
use url::Url;

// Used to bypass validation
pub static MAX_FEE: FieldElement = felt!("0xffffff");
pub static MAX_FEE: FieldElement = felt!("0x6efb28c75a0000");
pub static CHECK_INTERVAL: Duration = Duration::from_millis(500);

type StarknetAccount = SingleOwnerAccount<Arc<JsonRpcClient<HttpTransport>>, LocalWallet>;
Expand Down Expand Up @@ -91,7 +91,11 @@ impl GatlingShooter {
signer.clone(),
config.deployer.address,
config.setup.chain_id,
ExecutionEncoding::New,
if config.deployer.legacy_account {
ExecutionEncoding::Legacy
} else {
ExecutionEncoding::New
},
);

// Fails if nonce is null (which is the case for 1st startup)
Expand Down Expand Up @@ -756,7 +760,7 @@ impl GatlingShooter {
fee_token_address,
self.account.clone(),
address,
felt!("0xFFFFFFFFFFFFFF"),
felt!("0xFFFFFFFFFFFFFFFFFFFF"),
)
.await?;
wait_for_tx(&self.starknet_rpc, tx_hash, CHECK_INTERVAL).await?;
Expand Down
1 change: 1 addition & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ pub struct DeployerConfig {
pub salt: FieldElement,
pub address: FieldElement,
pub signing_key: FieldElement,
pub legacy_account: bool,
}

#[derive(Debug, Deserialize, Clone)]
Expand Down

0 comments on commit caa6179

Please sign in to comment.