Skip to content

Commit a537dc0

Browse files
authored
fix[da-light-node]: fix block proposer buffer size (#1223)
1 parent 4b56dbd commit a537dc0

File tree

9 files changed

+50
-49
lines changed

9 files changed

+50
-49
lines changed

networks/movement/movement-client/src/tests/complex-alice/Move.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ resource_roulette = '_'
99
[dev-addresses]
1010

1111
[dependencies.AptosFramework]
12-
git = "https://github.com/aptos-labs/aptos-core.git"
13-
rev = "mainnet"
12+
git = "https://github.com/movementlabsxyz/aptos-core.git"
13+
rev = "movement"
1414
subdir = "aptos-move/framework/aptos-framework"
1515

1616
[dev-dependencies]

networks/movement/movement-client/src/tests/complex-alice/deploy.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
# Initializes an account if keys are not present
44
echo "Initializing account"
5-
initialize_output=$(echo -ne '\n' | aptos init --network custom --rest-url $NODE_URL --faucet-url $FAUCET_URL --assume-yes)
5+
initialize_output=$(echo -ne '\n' | movement init --network custom --rest-url $NODE_URL --faucet-url $FAUCET_URL --assume-yes)
66
echo "$initialize_output"
77

88
echo "Publishing the module"
9-
aptos move clean --assume-yes
10-
aptos move publish --package-dir src/tests/complex-alice --named-addresses resource_roulette=default --assume-yes
9+
movement move clean --assume-yes
10+
movement move publish --package-dir src/tests/complex-alice --named-addresses resource_roulette=default --assume-yes

networks/movement/movement-client/src/tests/hey-partners/test.sh

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ ls
99
cd src/tests/hey-partners
1010

1111
# Initializes an account if keys are not present
12-
initialize_output=$(echo -ne '\n' | aptos init --network custom --rest-url $FULLNODE --faucet-url $FAUCET --assume-yes)
12+
initialize_output=$(echo -ne '\n' | movement init --network custom --rest-url $FULLNODE --faucet-url $FAUCET --assume-yes)
1313

14-
CONFIG_FILE=".aptos/config.yaml"
14+
CONFIG_FILE=".movement/config.yaml"
1515

1616
if [ ! -f "$CONFIG_FILE" ]; then
1717
echo "Initialization failed. Config file not found."
1818
exit 1
1919
fi
2020

21-
aptos move compile
21+
movement move compile
2222

2323
PrivateKey=$(grep 'private_key:' "$CONFIG_FILE" | awk -F': ' '{print $2}' | tr -d '"')
2424

2525
# Lookup the SwapDeployer address
26-
lookup_address_output=$(aptos account lookup-address)
26+
lookup_address_output=$(movement account lookup-address)
2727
echo "Lookup Address Output: $lookup_address_output"
2828
SwapDeployer=0x$(echo "$lookup_address_output" | grep -o '"Result": "[0-9a-fA-F]\{64\}"' | sed 's/"Result": "\(.*\)"/\1/')
2929
if [ -z "$SwapDeployer" ]; then
@@ -32,7 +32,7 @@ if [ -z "$SwapDeployer" ]; then
3232
fi
3333

3434
# Lookup the ResourceAccountDeployer address test IS expected to fail as long as we can retrieve the account address anyway
35-
test_resource_account_output=$(aptos move test --package-dir "$PATH_TO_REPO/Swap/" \
35+
test_resource_account_output=$(movement move test --package-dir "$PATH_TO_REPO/Swap/" \
3636
--filter test_resource_account --named-addresses SwapDeployer=$SwapDeployer,uq64x64=$SwapDeployer,u256=$SwapDeployer,ResourceAccountDeployer=$SwapDeployer)
3737
echo "Test Resource Account Output: $test_resource_account_output"
3838
ResourceAccountDeployer=$(echo "$test_resource_account_output" | grep -o '\[debug\] @[^\s]*' | sed 's/\[debug\] @\(.*\)/\1/')
@@ -69,123 +69,123 @@ add_or_update_env "FAUCET" $FAUCET
6969

7070
# publish
7171
echo "Publish uq64x64"
72-
aptos move publish --package-dir $PATH_TO_REPO/uq64x64/ --assume-yes --named-addresses uq64x64=$SwapDeployer
72+
movement move publish --package-dir $PATH_TO_REPO/uq64x64/ --assume-yes --named-addresses uq64x64=$SwapDeployer
7373
echo "Publish u256"
74-
aptos move publish --package-dir $PATH_TO_REPO/u256/ --assume-yes --named-addresses u256=$SwapDeployer
74+
movement move publish --package-dir $PATH_TO_REPO/u256/ --assume-yes --named-addresses u256=$SwapDeployer
7575
echo "Publish TestCoin"
76-
aptos move publish --package-dir $PATH_TO_REPO/TestCoin/ --assume-yes --named-addresses SwapDeployer=$SwapDeployer
76+
movement move publish --package-dir $PATH_TO_REPO/TestCoin/ --assume-yes --named-addresses SwapDeployer=$SwapDeployer
7777
echo "Publish Faucet"
78-
aptos move publish --package-dir $PATH_TO_REPO/Faucet/ --assume-yes --named-addresses SwapDeployer=$SwapDeployer
78+
movement move publish --package-dir $PATH_TO_REPO/Faucet/ --assume-yes --named-addresses SwapDeployer=$SwapDeployer
7979
echo "Publish Resource Account"
80-
aptos move publish --package-dir $PATH_TO_REPO/LPResourceAccount/ --assume-yes --named-addresses SwapDeployer=$SwapDeployer
80+
movement move publish --package-dir $PATH_TO_REPO/LPResourceAccount/ --assume-yes --named-addresses SwapDeployer=$SwapDeployer
8181
# create resource account & publish LPCoin
8282
# use this command to compile LPCoin
83-
aptos move compile --package-dir $PATH_TO_REPO/LPCoin/ --save-metadata --named-addresses ResourceAccountDeployer=$ResourceAccountDeployer
83+
movement move compile --package-dir $PATH_TO_REPO/LPCoin/ --save-metadata --named-addresses ResourceAccountDeployer=$ResourceAccountDeployer
8484
# get the first arg
8585
arg1=$(hexdump -ve '1/1 "%02x"' $PATH_TO_REPO/LPCoin/build/LPCoin/package-metadata.bcs)
8686
# get the second arg
8787
arg2=$(hexdump -ve '1/1 "%02x"' $PATH_TO_REPO/LPCoin/build/LPCoin/bytecode_modules/LPCoinV1.mv)
8888
# This command is to publish LPCoin contract, using ResourceAccountDeployer address. Note: replace two args with the above two hex
8989
echo "Initialize LPAccount"
90-
aptos move run --function-id ${SwapDeployer}::LPResourceAccount::initialize_lp_account \
90+
movement move run --function-id ${SwapDeployer}::LPResourceAccount::initialize_lp_account \
9191
--args hex:$arg1 hex:$arg2 --assume-yes
9292

9393
echo "Publishing MovementSwap"
94-
aptos move publish --package-dir $PATH_TO_REPO/Swap/ --assume-yes --named-addresses uq64x64=$SwapDeployer,u256=$SwapDeployer,SwapDeployer=$SwapDeployer,ResourceAccountDeployer=$ResourceAccountDeployer
94+
movement move publish --package-dir $PATH_TO_REPO/Swap/ --assume-yes --named-addresses uq64x64=$SwapDeployer,u256=$SwapDeployer,SwapDeployer=$SwapDeployer,ResourceAccountDeployer=$ResourceAccountDeployer
9595

9696
# admin steps
9797
# TestCoinsV1
9898
echo "Initialize TestCoinsV1"
99-
aptos move run --function-id ${SwapDeployer}::TestCoinsV1::initialize --assume-yes
99+
movement move run --function-id ${SwapDeployer}::TestCoinsV1::initialize --assume-yes
100100
echo "Mint USDT TestCoinsV1"
101-
aptos move run --function-id ${SwapDeployer}::TestCoinsV1::mint_coin \
101+
movement move run --function-id ${SwapDeployer}::TestCoinsV1::mint_coin \
102102
--args address:${SwapDeployer} u64:20000000000000000 \
103103
--type-args ${SwapDeployer}::TestCoinsV1::USDT --assume-yes
104104
echo "Mint BTC TestCoinsV1"
105-
aptos move run --function-id ${SwapDeployer}::TestCoinsV1::mint_coin \
105+
movement move run --function-id ${SwapDeployer}::TestCoinsV1::mint_coin \
106106
--args address:${SwapDeployer} u64:2000000000000 \
107107
--type-args ${SwapDeployer}::TestCoinsV1::BTC --assume-yes
108108

109109
# FaucetV1
110110
echo "Create USDT FaucetV1"
111-
aptos move run --function-id ${SwapDeployer}::FaucetV1::create_faucet \
111+
movement move run --function-id ${SwapDeployer}::FaucetV1::create_faucet \
112112
--args u64:10000000000000000 u64:1000000000 u64:3600 \
113113
--type-args ${SwapDeployer}::TestCoinsV1::USDT --assume-yes
114114
echo "Create BTC FaucetV1"
115-
aptos move run --function-id ${SwapDeployer}::FaucetV1::create_faucet \
115+
movement move run --function-id ${SwapDeployer}::FaucetV1::create_faucet \
116116
--args u64:1000000000000 u64:10000000 u64:3600 \
117117
--type-args ${SwapDeployer}::TestCoinsV1::BTC --assume-yes
118118

119119
# AnimeSwapPool
120120
echo "add USDT:MOVE pair"
121-
aptos move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::add_liquidity_entry \
121+
movement move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::add_liquidity_entry \
122122
--args u64:10000000000 u64:100000000 u64:1 u64:1 \
123123
--type-args ${SwapDeployer}::TestCoinsV1::USDT 0x1::aptos_coin::AptosCoin --assume-yes
124124
echo "add BTC:MOVE pair"
125-
aptos move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::add_liquidity_entry \
125+
movement move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::add_liquidity_entry \
126126
--args u64:10000000 u64:100000000 u64:1 u64:1 \
127127
--type-args ${SwapDeployer}::TestCoinsV1::BTC 0x1::aptos_coin::AptosCoin --assume-yes
128128
echo "add BTC:USDT pair"
129-
aptos move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::add_liquidity_entry \
129+
movement move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::add_liquidity_entry \
130130
--args u64:100000000 u64:100000000000 u64:1 u64:1 \
131131
--type-args ${SwapDeployer}::TestCoinsV1::BTC ${SwapDeployer}::TestCoinsV1::USDT --assume-yes
132132

133133
echo "Finished Admin Functions"
134134
# user
135135
# fund
136136
echo "Request USDT"
137-
aptos move run --function-id ${SwapDeployer}::FaucetV1::request \
137+
movement move run --function-id ${SwapDeployer}::FaucetV1::request \
138138
--args address:${SwapDeployer} \
139139
--type-args ${SwapDeployer}::TestCoinsV1::USDT --assume-yes
140140
echo "Request BTC"
141-
aptos move run --function-id ${SwapDeployer}::FaucetV1::request \
141+
movement move run --function-id ${SwapDeployer}::FaucetV1::request \
142142
--args address:${SwapDeployer} \
143143
--type-args ${SwapDeployer}::TestCoinsV1::BTC --assume-yes
144144
# swap (type args shows the swap direction, in this example, swap BTC to APT)
145145
echo "Swap exact BTC for MOVE"
146-
aptos move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::swap_exact_coins_for_coins_entry \
146+
movement move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::swap_exact_coins_for_coins_entry \
147147
--args u64:100 u64:1 \
148148
--type-args ${SwapDeployer}::TestCoinsV1::BTC 0x1::aptos_coin::AptosCoin --assume-yes
149149
# swap
150150
echo "Swap BTC for exact MOVE"
151-
aptos move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::swap_coins_for_exact_coins_entry \
151+
movement move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::swap_coins_for_exact_coins_entry \
152152
--args u64:100 u64:1000000000 \
153153
--type-args ${SwapDeployer}::TestCoinsV1::BTC 0x1::aptos_coin::AptosCoin --assume-yes
154154
# multiple pair swap (this example, swap 100 BTC->APT->USDT)
155155
echo "Swap BTC for USDT"
156-
aptos move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::swap_exact_coins_for_coins_2_pair_entry \
156+
movement move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::swap_exact_coins_for_coins_2_pair_entry \
157157
--args u64:100 u64:1 \
158158
--type-args ${SwapDeployer}::TestCoinsV1::BTC 0x1::aptos_coin::AptosCoin ${SwapDeployer}::TestCoinsV1::USDT --assume-yes
159159
# add lp (if pair not exist, will auto create lp first)
160160
echo "Add LP for BTC:MOVE"
161-
aptos move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::add_liquidity_entry \
161+
movement move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::add_liquidity_entry \
162162
--args u64:1000 u64:10000 u64:1 u64:1 \
163163
--type-args ${SwapDeployer}::TestCoinsV1::BTC 0x1::aptos_coin::AptosCoin --assume-yes
164164
echo "Remove LP from BTC:MOVE"
165-
aptos move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::remove_liquidity_entry \
165+
movement move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::remove_liquidity_entry \
166166
--args u64:1000 u64:1 u64:1 \
167167
--type-args ${SwapDeployer}::TestCoinsV1::BTC 0x1::aptos_coin::AptosCoin --assume-yes
168168

169169
# Admin cmd example
170170
echo "Set dao fee"
171-
aptos move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::set_dao_fee_to \
171+
movement move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::set_dao_fee_to \
172172
--args address:${SwapDeployer} --assume-yes
173173
echo "Set admin address"
174-
aptos move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::set_admin_address \
174+
movement move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::set_admin_address \
175175
--args address:${SwapDeployer} --assume-yes
176176
echo "set dao fee"
177-
aptos move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::set_dao_fee \
177+
movement move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::set_dao_fee \
178178
--args u64:5
179179
echo "set swap fee"
180-
aptos move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::set_swap_fee \
180+
movement move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::set_swap_fee \
181181
--args u64:30 --assume-yes
182182
echo "withdraw dao fee"
183-
aptos move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::withdraw_dao_fee \
183+
movement move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::withdraw_dao_fee \
184184
--type-args ${SwapDeployer}::TestCoinsV1::BTC ${SwapDeployer}::TestCoinsV1::USDT --assume-yes
185185
echo "pause"
186-
aptos move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::pause --assume-yes
186+
movement move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::pause --assume-yes
187187
echo "unpause"
188-
aptos move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::unpause --assume-yes
188+
movement move run --function-id ${SwapDeployer}::AnimeSwapPoolV1::unpause --assume-yes
189189

190190
echo "Finished User Functions"
191191

networks/movement/movement-client/src/tests/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ async fn test_complex_alice_internal() -> Result<(), anyhow::Error> {
309309

310310
// Get the root path of the cargo workspace
311311
let root: PathBuf = cargo_workspace()?;
312-
let additional_path = "networks/movement/movements-tests/src/tests/complex-alice/";
312+
let additional_path = "networks/movement/movement-client/src/tests/complex-alice/";
313313
let combined_path = root.join(additional_path);
314314

315315
// Convert the combined path to a string
@@ -324,7 +324,7 @@ async fn test_complex_alice_internal() -> Result<(), anyhow::Error> {
324324
let five_sec = time::Duration::from_millis(5000);
325325
thread::sleep(five_sec);
326326

327-
let yaml_content = fs::read_to_string(".aptos/config.yaml")?;
327+
let yaml_content = fs::read_to_string(".movement/config.yaml")?;
328328

329329
let config: Config = serde_yaml::from_str(&yaml_content)?;
330330

@@ -584,7 +584,7 @@ pub async fn test_hey_partners() -> Result<(), anyhow::Error> {
584584

585585
async fn test_hey_partners_internal() -> Result<(), anyhow::Error> {
586586
let root: PathBuf = cargo_workspace()?;
587-
let additional_path = "networks/movement/movements-tests/src/tests/hey-partners/";
587+
let additional_path = "networks/movement/movement-client/src/tests/hey-partners/";
588588
let combined_path = root.join(additional_path);
589589

590590
let test = combined_path.to_string_lossy();

process-compose/movement-full-node/process-compose.complex-alice-load.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ processes:
66

77
complex-alice-tests:
88
command: |
9-
LOADTEST_NUMBER_SCENARIO=30 LOADTEST_NUMBER_SCENARIO_PER_CLIENT=10 cargo test -p movement-tests complex_alice_load -- --nocapture
9+
LOADTEST_NUMBER_SCENARIO=30 LOADTEST_NUMBER_SCENARIO_PER_CLIENT=10 cargo test -p movement-client complex_alice_load -- --nocapture
1010
depends_on:
1111
movement-full-node:
1212
condition: process_healthy

process-compose/movement-full-node/process-compose.complex-alice-soak.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ processes:
66

77
complex-alice-tests:
88
command: |
9-
LOADTEST_NUMBER_SCENARIO=1 LOADTEST_NUMBER_SCENARIO_PER_CLIENT=1 cargo test -p movement-tests complex_alice_soak -- --nocapture
9+
LOADTEST_NUMBER_SCENARIO=1 LOADTEST_NUMBER_SCENARIO_PER_CLIENT=1 cargo test -p movement-client complex_alice_soak -- --nocapture
1010
depends_on:
1111
movement-full-node:
1212
condition: process_healthy

process-compose/movement-full-node/process-compose.hey-partners-load.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ processes:
88
env:
99
MOVEMENT_SWAP_PATH: ${MOVEMENT_SWAP_PATH}
1010
command: |
11-
LOADTEST_NUMBER_SCENARIO=1 LOADTEST_NUMBER_SCENARIO_PER_CLIENT=1 cargo test -p movement-tests hey_partners_load -- --nocapture
11+
LOADTEST_NUMBER_SCENARIO=1 LOADTEST_NUMBER_SCENARIO_PER_CLIENT=1 cargo test -p movement-client hey_partners_load -- --nocapture
1212
depends_on:
1313
movement-full-node:
1414
condition: process_healthy

process-compose/movement-full-node/process-compose.hey-partners-soak.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ processes:
88
env:
99
MOVEMENT_SWAP_PATH: ${MOVEMENT_SWAP_PATH}
1010
command: |
11-
LOADTEST_NUMBER_SCENARIO=1 LOADTEST_NUMBER_SCENARIO_PER_CLIENT=1 cargo test -p movement-tests hey_partners_soak -- --nocapture
11+
LOADTEST_NUMBER_SCENARIO=1 LOADTEST_NUMBER_SCENARIO_PER_CLIENT=1 cargo test -p movement-client hey_partners_soak -- --nocapture
1212
depends_on:
1313
movement-full-node:
1414
condition: process_healthy

protocol-units/da/movement/protocol/light-node/src/sequencer.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ use std::time::Duration;
3434
use crate::{passthrough::LightNode as LightNodePassThrough, LightNodeRuntime};
3535

3636
const LOGGING_UID: AtomicU64 = AtomicU64::new(0);
37+
const BLOCK_PROPOSER_CHANNEL_BUFFER_SIZE: usize = 2usize.pow(10);
3738

3839
#[derive(Clone)]
3940
pub struct LightNode<O, C, Da, V>
@@ -279,10 +280,10 @@ where
279280
}
280281

281282
pub async fn run_block_proposer(&self) -> Result<(), anyhow::Error> {
282-
let (sender, mut receiver) = tokio::sync::mpsc::channel(2 ^ 10);
283+
let (sender, mut receiver) = tokio::sync::mpsc::channel(BLOCK_PROPOSER_CHANNEL_BUFFER_SIZE);
283284

284285
loop {
285-
info!(target: "movement_timing", "START: run_block_propoer iteration");
286+
info!(target: "movement_timing", "START: run_block_proposer iteration");
286287
match futures::try_join!(
287288
self.run_block_builder(sender.clone()),
288289
self.run_block_publisher(&mut receiver),

0 commit comments

Comments
 (0)