Skip to content

Commit ebb1fd4

Browse files
authored
Merge pull request #6747 from multiversx/rc/andromeda
Rc/andromeda
2 parents a8f913e + 9f2444e commit ebb1fd4

File tree

683 files changed

+43982
-9391
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

683 files changed

+43982
-9391
lines changed

.github/workflows/build_and_run_chain_simulator_and_execute_system_test.yml

Lines changed: 92 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,27 @@ jobs:
6262
with:
6363
github-token: ${{ secrets.GITHUB_TOKEN }}
6464
script: |
65-
// Get the latest comment
65+
// Get all comments
6666
const comments = await github.rest.issues.listComments({
6767
owner: context.repo.owner,
6868
repo: context.repo.repo,
6969
issue_number: context.issue.number,
7070
});
7171
72-
const lastComment = comments.data.pop(); // Get the last comment
72+
// Find the last comment that contains 'Run Tests:'
73+
let lastTestComment = null;
74+
for (let i = comments.data.length - 1; i >= 0; i--) {
75+
if (comments.data[i].body.includes('Run Tests:')) {
76+
lastTestComment = comments.data[i];
77+
break;
78+
}
79+
}
7380
74-
if (lastComment && lastComment.body.includes('Run Tests:')) {
75-
const body = lastComment.body.trim();
81+
if (lastTestComment) {
82+
const body = lastTestComment.body.trim();
7683
core.setOutput('latest_comment', body);
7784
78-
// Parse the branches from the last comment
85+
// Parse the branches from the last test comment
7986
const simulatorBranchMatch = body.match(/mx-chain-simulator-go:\s*(\S+)/);
8087
const testingSuiteBranchMatch = body.match(/mx-chain-testing-suite:\s*(\S+)/);
8188
@@ -86,8 +93,11 @@ jobs:
8693
if (testingSuiteBranchMatch) {
8794
core.exportVariable('MX_CHAIN_TESTING_SUITE_TARGET_BRANCH', testingSuiteBranchMatch[1]);
8895
}
96+
97+
// Log which comment was used for configuration
98+
core.info(`Found 'Run Tests:' comment from ${lastTestComment.user.login} at ${lastTestComment.created_at}`);
8999
} else {
90-
core.info('The last comment does not contain "Run Tests:". Skipping branch override.');
100+
core.info('No comment containing "Run Tests:" was found. Using default branch settings.');
91101
}
92102
93103

@@ -146,6 +156,82 @@ jobs:
146156
go build
147157
echo "CHAIN_SIMULATOR_BUILD_PATH=$(pwd)" >> $GITHUB_ENV
148158
159+
- name: Initialize Chain Simulator
160+
run: |
161+
cd mx-chain-simulator-go/cmd/chainsimulator
162+
163+
# Start ChainSimulator with minimal args to initialize configs
164+
INIT_LOG_FILE="/tmp/chainsim_init.log"
165+
echo "Starting ChainSimulator initialization process..."
166+
./chainsimulator > $INIT_LOG_FILE 2>&1 &
167+
INIT_PROCESS_PID=$!
168+
169+
# Verify the process is running
170+
if ! ps -p $INIT_PROCESS_PID > /dev/null; then
171+
echo "Failed to start ChainSimulator process"
172+
cat $INIT_LOG_FILE
173+
exit 1
174+
fi
175+
176+
# Wait for the initialization to complete - look for multiple possible success patterns
177+
INIT_COMPLETED=false
178+
RETRY_COUNT=0
179+
MAX_RETRIES=60 # Increase timeout to 60 seconds
180+
181+
echo "Waiting for ChainSimulator initialization..."
182+
while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
183+
# Check for any of these success patterns
184+
if grep -q "starting as observer node" $INIT_LOG_FILE || \
185+
grep -q "ChainSimulator started successfully" $INIT_LOG_FILE || \
186+
grep -q "initialized the node" $INIT_LOG_FILE || \
187+
grep -q "Node is running" $INIT_LOG_FILE; then
188+
INIT_COMPLETED=true
189+
echo "ChainSimulator initialization completed successfully"
190+
break
191+
fi
192+
193+
# If there's a known fatal error, exit early
194+
if grep -q "fatal error" $INIT_LOG_FILE || grep -q "panic:" $INIT_LOG_FILE; then
195+
echo "Fatal error detected during initialization:"
196+
grep -A 10 -E "fatal error|panic:" $INIT_LOG_FILE
197+
break
198+
fi
199+
200+
# Print progress every 10 seconds
201+
if [ $((RETRY_COUNT % 10)) -eq 0 ]; then
202+
echo "Still waiting for initialization... ($RETRY_COUNT seconds elapsed)"
203+
tail -5 $INIT_LOG_FILE
204+
fi
205+
206+
RETRY_COUNT=$((RETRY_COUNT+1))
207+
sleep 1
208+
done
209+
210+
# Kill the initialization process - try graceful shutdown first
211+
echo "Stopping initialization process (PID: $INIT_PROCESS_PID)..."
212+
kill -TERM $INIT_PROCESS_PID 2>/dev/null || true
213+
sleep 3
214+
215+
# Check if process still exists and force kill if needed
216+
if ps -p $INIT_PROCESS_PID > /dev/null 2>&1; then
217+
echo "Process still running, forcing kill..."
218+
kill -9 $INIT_PROCESS_PID 2>/dev/null || true
219+
sleep 1
220+
fi
221+
222+
if [ "$INIT_COMPLETED" != "true" ]; then
223+
echo "ChainSimulator initialization failed after $MAX_RETRIES seconds"
224+
echo "Last 20 lines of log:"
225+
tail -20 $INIT_LOG_FILE
226+
exit 1
227+
fi
228+
229+
# Create a marker file to indicate successful initialization
230+
touch /tmp/chain_simulator_initialized.lock
231+
echo "Chain Simulator successfully initialized"
232+
233+
echo "Initialization log stored at: $INIT_LOG_FILE"
234+
149235
- name: Checkout mx-chain-testing-suite
150236
uses: actions/checkout@v4
151237
with:

cmd/node/config/config.toml

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@
4040
# Make sure that this is greater than the unbonding period!
4141
SetGuardianEpochsDelay = 2 # TODO: for mainnet should be 20, 2 is just for testing
4242

43+
# ChainParametersByEpoch defines chain operation configurable values that can be modified based on epochs
44+
ChainParametersByEpoch = [
45+
{ EnableEpoch = 0, RoundDuration = 6000, ShardConsensusGroupSize = 7, ShardMinNumNodes = 10, MetachainConsensusGroupSize = 10, MetachainMinNumNodes = 10, Hysteresis = 0.2, Adaptivity = false },
46+
{ EnableEpoch = 8, RoundDuration = 6000, ShardConsensusGroupSize = 10, ShardMinNumNodes = 10, MetachainConsensusGroupSize = 10, MetachainMinNumNodes = 10, Hysteresis = 0.2, Adaptivity = false }
47+
]
48+
49+
# EpochChangeGracePeriodEnableEpoch represents the configuration of different grace periods for epoch change with their activation epochs
50+
EpochChangeGracePeriodByEpoch = [
51+
{EnableEpoch = 0, GracePeriodInRounds = 1 },
52+
{EnableEpoch = 8, GracePeriodInRounds = 10 }, # Andromeda epoch comes with a longer grace period
53+
]
54+
4355
[HardwareRequirements]
4456
CPUFlags = ["SSE4", "SSE42"]
4557

@@ -186,6 +198,19 @@
186198
MaxBatchSize = 100
187199
MaxOpenFiles = 10
188200

201+
[ProofsStorage]
202+
[ProofsStorage.Cache]
203+
Name = "ProofsStorage"
204+
Capacity = 1000
205+
Type = "SizeLRU"
206+
SizeInBytes = 20971520 #20MB
207+
[ProofsStorage.DB]
208+
FilePath = "Proofs"
209+
Type = "LvlDBSerial"
210+
BatchDelaySeconds = 2
211+
MaxBatchSize = 100
212+
MaxOpenFiles = 10
213+
189214
[TxStorage]
190215
[TxStorage.Cache]
191216
Name = "TxStorage"
@@ -365,6 +390,10 @@
365390
MaxHeadersPerShard = 1000
366391
NumElementsToRemoveOnEviction = 200
367392

393+
[ProofsPoolConfig]
394+
CleanupNonceDelta = 3
395+
BucketSize = 100
396+
368397
[BadBlocksCache]
369398
Name = "BadBlocksCache"
370399
Capacity = 1000
@@ -497,7 +526,7 @@
497526
IntervalInSeconds = 1
498527
ReservedPercent = 20.0
499528
[Antiflood.FastReacting.PeerMaxInput]
500-
BaseMessagesPerInterval = 140
529+
BaseMessagesPerInterval = 280
501530
TotalSizePerInterval = 4194304 #4MB/s
502531
[Antiflood.FastReacting.PeerMaxInput.IncreaseFactor]
503532
Threshold = 10 #if consensus size will exceed this value, then
@@ -539,7 +568,7 @@
539568
PeerBanDurationInSeconds = 3600
540569

541570
[Antiflood.PeerMaxOutput]
542-
BaseMessagesPerInterval = 75
571+
BaseMessagesPerInterval = 150
543572
TotalSizePerInterval = 2097152 #2MB/s
544573

545574
[Antiflood.Cache]
@@ -672,8 +701,7 @@
672701
TimeOutForSCExecutionInMilliseconds = 10000 # 10 seconds = 10000 milliseconds
673702
WasmerSIGSEGVPassthrough = false # must be false for release
674703
WasmVMVersions = [
675-
{ StartEpoch = 0, Version = "v1.4" },
676-
{ StartEpoch = 1, Version = "v1.5" }, # TODO: set also the RoundActivations.DisableAsyncCallV1 accordingly
704+
{ StartEpoch = 0, Version = "v1.5" },
677705
]
678706
TransferAndExecuteByUserAddresses = [ # TODO: set real contract addresses for all shards
679707
"erd1qqqqqqqqqqqqqpgqr46jrxr6r2unaqh75ugd308dwx5vgnhwh47qtvepe3", #shard 0
@@ -684,8 +712,7 @@
684712
TimeOutForSCExecutionInMilliseconds = 10000 # 10 seconds = 10000 milliseconds
685713
WasmerSIGSEGVPassthrough = false # must be false for release
686714
WasmVMVersions = [
687-
{ StartEpoch = 0, Version = "v1.4" },
688-
{ StartEpoch = 1, Version = "v1.5" }, # TODO: set also the RoundActivations.DisableAsyncCallV1 accordingly
715+
{ StartEpoch = 0, Version = "v1.5" },
689716
]
690717
TransferAndExecuteByUserAddresses = [ # TODO: set real contract addresses for all shards
691718
"erd1qqqqqqqqqqqqqpgqr46jrxr6r2unaqh75ugd308dwx5vgnhwh47qtvepe3",
@@ -946,3 +973,7 @@
946973
# MaxRoundsOfInactivityAccepted defines the number of rounds missed by a main or higher level backup machine before
947974
# the current machine will take over and propose/sign blocks. Used in both single-key and multi-key modes.
948975
MaxRoundsOfInactivityAccepted = 3
976+
977+
[InterceptedDataVerifier]
978+
CacheSpanInSec = 30
979+
CacheExpiryInSec = 30

cmd/node/config/enableEpochs.toml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
BuiltInFunctionsEnableEpoch = 0
77

88
# RelayedTransactionsEnableEpoch represents the epoch when the relayed transactions will be enabled
9-
RelayedTransactionsEnableEpoch = 1
9+
RelayedTransactionsEnableEpoch = 0
1010

1111
# PenalizedTooMuchGasEnableEpoch represents the epoch when the penalization for using too much gas will be enabled
1212
PenalizedTooMuchGasEnableEpoch = 0
@@ -76,7 +76,7 @@
7676
CorrectLastUnjailedEnableEpoch = 1
7777

7878
# RelayedTransactionsV2EnableEpoch represents the epoch when the relayed transactions V2 will be enabled
79-
RelayedTransactionsV2EnableEpoch = 1
79+
RelayedTransactionsV2EnableEpoch = 0
8080

8181
# UnbondTokensV2EnableEpoch represents the epoch when the new implementation of the unbond tokens function is available
8282
UnbondTokensV2EnableEpoch = 1
@@ -339,6 +339,12 @@
339339
# RelayedTransactionsV3FixESDTTransferEnableEpoch represents the epoch when the fix for relayed transactions v3 with esdt transfer will be enabled
340340
RelayedTransactionsV3FixESDTTransferEnableEpoch = 1 # TODO: keep this equal to RelayedTransactionsV3EnableEpoch for mainnet
341341

342+
# AndromedaEnableEpoch represents the epoch when the equivalent messages and fix order for consensus features are enabled
343+
AndromedaEnableEpoch = 8 # the chain simulator tests for staking v4 fail if this is set earlier, as they test the transition in epochs 4-7
344+
345+
# CheckBuiltInCallOnTransferValueAndFailEnableRound represents the ROUND when the check on transfer value fix is activated
346+
CheckBuiltInCallOnTransferValueAndFailEnableRound = 1
347+
342348
# BLSMultiSignerEnableEpoch represents the activation epoch for different types of BLS multi-signers
343349
BLSMultiSignerEnableEpoch = [
344350
{ EnableEpoch = 0, Type = "no-KOSK" },
@@ -359,5 +365,5 @@
359365
[GasSchedule]
360366
# GasScheduleByEpochs holds the configuration for the gas schedule that will be applied from specific epochs
361367
GasScheduleByEpochs = [
362-
{ StartEpoch = 0, FileName = "gasScheduleV8.toml" },
368+
{ StartEpoch = 0, FileName = "gasScheduleV9.toml" },
363369
]

cmd/node/config/enableRounds.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
[RoundActivations]
1111
[RoundActivations.DisableAsyncCallV1]
1212
Options = []
13-
Round = "100"
13+
Round = "0"

0 commit comments

Comments
 (0)