Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ permissions:

env:
ANVIL_TAG: nightly-2cdbfaca634b284084d0f86357623aef7a0d2ce3
ROLLUPS_NODE_VERSION: 2.0.0-alpha.4

jobs:
build_node_v2:
name: Build Node v2
if: github.ref == 'refs/heads/track/node-next-2.0'
runs-on: ubuntu-latest
env:
CARTESI_POSTGRES_ENDPOINT: 'postgres://postgres:password@localhost:5432/rollupsdb?sslmode=disable'
Expand All @@ -30,8 +32,8 @@ jobs:

- name: Clone Node V2 (avoid submodules)
run: |
git clone -b v2.0.0-alpha.3 --depth 1 --recurse-submodules https://github.com/cartesi/rollups-node.git

git clone -b v${ROLLUPS_NODE_VERSION} --depth 1 --recurse-submodules https://github.com/cartesi/rollups-node.git
- name: Wait for PostgreSQL to be ready
run: |
for i in {1..30}; do
Expand Down Expand Up @@ -61,7 +63,9 @@ jobs:

- name: Build Node v2 image
run: |
docker build --build-arg TARGETARCH=amd64 -t node_v2 -f ./ci/Dockerfile .
docker build --build-arg TARGETARCH=amd64 \
--build-arg ROLLUPS_NODE_VERSION=${ROLLUPS_NODE_VERSION} \
-t node_v2 -f ./ci/Dockerfile .

- name: Start Node v2 image
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/loadtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- main
- track/node-next-2.0

jobs:
k6-test:
Expand Down
9 changes: 5 additions & 4 deletions ci/scripts/send_inputs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Global variables
INPUT_BOX_ADDRESS=0xB6b39Fb3dD926A9e3FBc7A129540eEbeA3016a6c
APPLICATION_ADDRESS=0x8e3c7bF65833ccb1755dAB530Ef0405644FE6ae3
MNEMONIC="test test test test test test test test test test test junk"
PRIVATE_KEY="0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"
RPC_URL="http://localhost:8545"

# Loop for execute the command 101 times with sequential hexadecimal INPUT
Expand All @@ -14,16 +14,17 @@ for ((i=0; i<101; i++)); do
# Execute the command in line
echo "Running the command $((i+1)) of 101 with INPUT=$INPUT..."
cast send \
--mnemonic "$MNEMONIC" \
--private-key "$PRIVATE_KEY" \
--rpc-url "$RPC_URL" \
--nonce $i\
--async \
$INPUT_BOX_ADDRESS "addInput(address,bytes)(bytes32)" $APPLICATION_ADDRESS $INPUT

# Verify if the last command was successful
if [[ $? -ne 0 ]]; then
echo "Error executing the command $((i+1)). Stopping the script."
exit 1
fi
sleep 1
done

sleep 10
echo "All commands were executed successfully!"
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (s *SynchronizerOutputExecutedSuite) TestUpdateOutputsExecuted() {
err = s.synchronizerOutputCreate.SyncOutputs(ctx)
s.Require().NoError(err)
second = s.countOurOutputs(ctx)
s.Equal(198, second)
s.Equal(202, second)

// check setup
executedCount := s.countExecuted(ctx)
Expand All @@ -149,15 +149,15 @@ func (s *SynchronizerOutputExecutedSuite) TestUpdateOutputsExecuted() {
err = s.synchronizerOutputExecuted.SyncOutputsExecution(ctx)
s.Require().NoError(err)
second = s.countExecuted(ctx)
s.Equal(TOTAL_INPUT_TEST-1, second)
s.Equal(TOTAL_INPUT_TEST, second)
err = s.synchronizerOutputExecuted.SyncOutputsExecution(ctx)
s.Require().NoError(err)
third := s.countExecuted(ctx)
s.Equal(TOTAL_INPUT_TEST-1, third)
s.Equal(TOTAL_INPUT_TEST+1, third)
err = s.synchronizerOutputExecuted.SyncOutputsExecution(ctx)
s.Require().NoError(err)
lastCount := s.countExecuted(ctx)
s.Equal(TOTAL_INPUT_TEST-1, lastCount)
s.Equal(TOTAL_INPUT_TEST+1, lastCount)
// s.Fail("uncomment this line just to see the logs")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (s *SynchronizerReportSuite) TestCreateAllReports() {
err = s.synchronizerReport.SyncReports(ctx)
s.Require().NoError(err)
second := s.countHLReports(ctx)
s.Equal(TOTAL_INPUT_TEST-1, second)
s.Equal(TOTAL_INPUT_TEST, second)
}

func (s *SynchronizerReportSuite) countHLReports(ctx context.Context) int {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (s *SynchronizerUpdateNodeSuite) TestUpdateInputStatusNotEqNone() {
none := s.getNoneInputs(ctx)
slog.Debug("None", "none", none)
second := s.countAcceptedInput(ctx)
s.Equal(TOTAL_INPUT_TEST-1, second)
s.Equal(TOTAL_INPUT_TEST, second)
}

func (s *SynchronizerUpdateNodeSuite) countInputWithStatusNone(ctx context.Context) int {
Expand Down
Loading
Loading