Skip to content

Commit 42984bd

Browse files
committed
few updates and temporary stop auto calculation
1 parent ed1d2ab commit 42984bd

File tree

3 files changed

+79
-76
lines changed

3 files changed

+79
-76
lines changed
Lines changed: 75 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,87 @@
1-
name: "Calculate rewards"
1+
# name: "Calculate rewards"
22

3-
on:
4-
schedule:
5-
- cron: '30 7 * * 1' # Every Monday at 07:30 UCT
6-
- cron: '30 19 * * 4' # Every Thursday at 19:30 UCT
7-
workflow_dispatch:
8-
inputs:
9-
first_reward_epoch:
10-
description: "Reward epoch (Last epoch if of-four)"
11-
type: number
12-
reward_amount_epoch_wei:
13-
description: "Reward amount (in wei)"
14-
type: number
15-
trigger_generate_report_workflow:
16-
description: "Run github pages deployment workflow"
17-
type: string
18-
required: true
19-
default: 'true'
3+
# on:
4+
# # schedule:
5+
# # - cron: '30 7 * * 1' # Every Monday at 07:30 UCT
6+
# # - cron: '30 19 * * 4' # Every Thursday at 19:30 UCT
7+
# workflow_dispatch:
8+
# inputs:
9+
# first_reward_epoch:
10+
# description: "Reward epoch (Last epoch if of-four)"
11+
# type: number
12+
# reward_amount_epoch_wei:
13+
# description: "Reward amount (in wei)"
14+
# type: number
15+
# trigger_generate_report_workflow:
16+
# description: "Run github pages deployment workflow"
17+
# type: string
18+
# required: true
19+
# default: 'true'
2020

2121

22-
permissions:
23-
contents: write
24-
actions: write
22+
# permissions:
23+
# contents: write
24+
# actions: write
2525

26-
jobs:
27-
process-staking-rewards:
28-
runs-on: ubuntu-latest
29-
steps:
30-
- uses: actions/checkout@v4
31-
- uses: actions/setup-node@v3
32-
with:
33-
node-version: 20
34-
- name: Install jq
35-
run: sudo apt update -y && sudo apt install jq moreutils -y
36-
- name: Install node modules
37-
run: yarn install --frozen-lockfile
38-
- name: Calculate epoch vars
39-
run: |
40-
export REWARD_EPOCH_DEFINED="${{ github.event.inputs.first_reward_epoch }}"
41-
export REWARD_EPOCH_CALCULATED="$(node .github/workflows/get-current-reward-epoch.js)"
42-
export USE_REWARD_EPOCH="${REWARD_EPOCH_DEFINED:-$REWARD_EPOCH_CALCULATED}"
43-
echo "USE_REWARD_EPOCH=$USE_REWARD_EPOCH" >> "$GITHUB_ENV"
26+
# jobs:
27+
# process-staking-rewards:
28+
# runs-on: ubuntu-latest
29+
# steps:
30+
# - uses: actions/checkout@v4
31+
# - uses: actions/setup-node@v3
32+
# with:
33+
# node-version: 20
34+
# - name: Install jq
35+
# run: sudo apt update -y && sudo apt install jq moreutils -y
36+
# - name: Install node modules
37+
# run: yarn install --frozen-lockfile
38+
# - name: Calculate epoch vars
39+
# run: |
40+
# export REWARD_EPOCH_DEFINED="${{ github.event.inputs.first_reward_epoch }}"
41+
# export REWARD_EPOCH_CALCULATED="$(node .github/workflows/get-current-reward-epoch.js)"
42+
# export USE_REWARD_EPOCH="${REWARD_EPOCH_DEFINED:-$REWARD_EPOCH_CALCULATED}"
43+
# echo "USE_REWARD_EPOCH=$USE_REWARD_EPOCH" >> "$GITHUB_ENV"
4444

45-
export USE_FIRST_REWARD_EPOCH="$((${USE_REWARD_EPOCH} - 3))"
46-
echo "USE_FIRST_REWARD_EPOCH=${USE_FIRST_REWARD_EPOCH}" >> "$GITHUB_ENV"
45+
# export USE_FIRST_REWARD_EPOCH="$((${USE_REWARD_EPOCH} - 3))"
46+
# echo "USE_FIRST_REWARD_EPOCH=${USE_FIRST_REWARD_EPOCH}" >> "$GITHUB_ENV"
4747

48-
echo "EPOCH_OF4_if0=$(( $(( $USE_REWARD_EPOCH - 1 )) % 4 ))" >> "$GITHUB_ENV"
48+
# echo "EPOCH_OF4_if0=$(( $(( $USE_REWARD_EPOCH - 1 )) % 4 ))" >> "$GITHUB_ENV"
4949

50-
- name: Set reward amount wei overwrite
51-
if: github.event.inputs.reward_amount_epoch_wei != ''
52-
run: jq --raw-output --monochrome-output --argjson amount "${{ github.event.inputs.reward_amount_epoch_wei }}" '.REWARD_AMOUNT_EPOCH_WEI = $amunt' configs/networks/flare.json | sponge configs/networks/flare.json
50+
# - name: Set reward amount wei overwrite
51+
# if: github.event.inputs.reward_amount_epoch_wei != ''
52+
# run: jq --raw-output --monochrome-output --argjson amount "${{ github.event.inputs.reward_amount_epoch_wei }}" '.REWARD_AMOUNT_EPOCH_WEI = $amunt' configs/networks/flare.json | sponge configs/networks/flare.json
5353

54-
- name: Process staking rewards for ${{ env.USE_REWARD_EPOCH }}
55-
run: |
56-
jq --raw-output --monochrome-output '.NUM_EPOCHS = 1' configs/networks/flare.json | sponge configs/networks/flare.json
57-
jq --raw-output --monochrome-output --argjson epoch "$USE_REWARD_EPOCH" '.REWARD_EPOCH = $epoch' configs/networks/flare.json | sponge configs/networks/flare.json
58-
yarn run process-staking-rewards
54+
# - name: Process staking rewards for ${{ env.USE_REWARD_EPOCH }}
55+
# run: |
56+
# jq --raw-output --monochrome-output '.NUM_EPOCHS = 1' configs/networks/flare.json | sponge configs/networks/flare.json
57+
# jq --raw-output --monochrome-output --argjson epoch "$USE_REWARD_EPOCH" '.REWARD_EPOCH = $epoch' configs/networks/flare.json | sponge configs/networks/flare.json
58+
# yarn run process-staking-rewards
5959

60-
- name: Combine rewards for [epoch ${{ env.USE_FIRST_REWARD_EPOCH }}-${{ env.USE_REWARD_EPOCH }}]
61-
if: env.EPOCH_OF4_if0 == 0
62-
run: |
63-
jq --raw-output --monochrome-output '.NUM_EPOCHS = 4' configs/networks/flare.json | sponge configs/networks/flare.json
64-
jq --raw-output --monochrome-output --argjson epoch "$USE_REWARD_EPOCH" '.REWARD_EPOCH = $epoch' configs/networks/flare.json | sponge configs/networks/flare.json
65-
yarn sum-staking-rewards
60+
# - name: Combine rewards for [epoch ${{ env.USE_FIRST_REWARD_EPOCH }}-${{ env.USE_REWARD_EPOCH }}]
61+
# if: env.EPOCH_OF4_if0 == 0
62+
# run: |
63+
# jq --raw-output --monochrome-output '.NUM_EPOCHS = 4' configs/networks/flare.json | sponge configs/networks/flare.json
64+
# jq --raw-output --monochrome-output --argjson epoch "$USE_REWARD_EPOCH" '.REWARD_EPOCH = $epoch' configs/networks/flare.json | sponge configs/networks/flare.json
65+
# yarn sum-staking-rewards
6666

67-
- name: Commit generated-files
68-
run: |
69-
git config --global user.name 'Reward scripts automation'
70-
git config --global user.email 'flare-foundation-reward-scripts-automation@users.noreply.github.com'
71-
git add generated-files/reward-epoch-${{ env.USE_REWARD_EPOCH }}
72-
if [ "$EPOCH_OF4_if0" -eq 0 ]; then git add generated-files/validator-rewards/epochs-${{ env.USE_FIRST_REWARD_EPOCH }}-${{ env.USE_REWARD_EPOCH }}.json; fi
73-
git commit -m "Processed staking rewards for epoch ${{ env.USE_REWARD_EPOCH }}" && git push || echo "No changes were present, failed to commit, proceeding..."
67+
# - name: Commit generated-files
68+
# run: |
69+
# git config --global user.name 'Reward scripts automation'
70+
# git config --global user.email 'flare-foundation-reward-scripts-automation@users.noreply.github.com'
71+
# git add generated-files/reward-epoch-${{ env.USE_REWARD_EPOCH }}
72+
# if [ "$EPOCH_OF4_if0" -eq 0 ]; then git add generated-files/validator-rewards/epochs-${{ env.USE_FIRST_REWARD_EPOCH }}-${{ env.USE_REWARD_EPOCH }}.json; fi
73+
# git commit -m "Processed staking rewards for epoch ${{ env.USE_REWARD_EPOCH }}" && git push || echo "No changes were present, failed to commit, proceeding..."
7474

75-
- name: Upload artifacts
76-
uses: actions/upload-artifact@v3
77-
with:
78-
name: staking-rewards
79-
path: |
80-
generated-files/reward-epoch-${{ env.USE_REWARD_EPOCH }}
81-
generated-files/validator-rewards/epochs-${{ env.USE_FIRST_REWARD_EPOCH }}-${{ env.USE_REWARD_EPOCH }}.json
75+
# - name: Upload artifacts
76+
# uses: actions/upload-artifact@v3
77+
# with:
78+
# name: staking-rewards
79+
# path: |
80+
# generated-files/reward-epoch-${{ env.USE_REWARD_EPOCH }}
81+
# generated-files/validator-rewards/epochs-${{ env.USE_FIRST_REWARD_EPOCH }}-${{ env.USE_REWARD_EPOCH }}.json
8282

83-
- name: Trigger "generate report" workflow
84-
if: github.event.inputs.trigger_generate_report_workflow == 'true' || github.event.inputs.trigger_generate_report_workflow == ''
85-
env:
86-
GH_TOKEN: ${{ github.token }}
87-
run: gh workflow run "Generate report" -f first_reward_epoch=${{ env.USE_REWARD_EPOCH }}
83+
# - name: Trigger "generate report" workflow
84+
# if: github.event.inputs.trigger_generate_report_workflow == 'true' || github.event.inputs.trigger_generate_report_workflow == ''
85+
# env:
86+
# GH_TOKEN: ${{ github.token }}
87+
# run: gh workflow run "Generate report" -f first_reward_epoch=${{ env.USE_REWARD_EPOCH }}

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ You can also run it with optional parameters from [file](./src/processProviders.
4040

4141
For each run output of the process is in folder `generated-files/reward-epochs-<REWARD_EPOCH>`.
4242

43+
### Verifying the results
4344
To verify the official results posted in this repository one needs to update its configuration file with values from the `configFileData` object of a `data.json` file for some reward epoch.
45+
To verify the results for the reward epochs from 126 to 243 inclusive one needs to use branch `version-1`.
4446

4547
### Data for distributing rewards
4648
Rewards will be distributed every four reward epochs, which means that every 14 days reward amounts from the past four reward epochs will be summed. This is achieved by running the process

ftso-address.csv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,5 @@ Encode Club,0x1c2bb2ca14914a462ab7268de4a48ef6445116c2,NodeID-9fsCXCFJ7hzgsGK4FV
108108
FlareFi,0x184DbC7F2D96aBDfDe5CDa8c56F3F13DbF138cdF,NodeID-8aGBxZssVWRvEr57YGRsWjZTHbnoWrfcc,235
109109
Bifrost Wallet 2,0x9A46864A3b0a7805B266C445289C3fAD1E48f18e,NodeID-GZEWkCpn852hwKhbGNJgZvbjtvEfU6Ktg,238
110110
Oracle Daemon,0xfe532cB6Fb3C47940aeA7BeAd4d61C5e041D950e,NodeID-GEC63GVfeYLG5UUBPSgiiN4YMvT71jdP,241
111-
Oracle Daemon,0xfe532cB6Fb3C47940aeA7BeAd4d61C5e041D950e,NodeID-2miZhA7JAnyf9s5rYzDeNciwg4448LKsP,241
111+
Oracle Daemon,0xfe532cB6Fb3C47940aeA7BeAd4d61C5e041D950e,NodeID-2miZhA7JAnyf9s5rYzDeNciwg4448LKsP,241
112+
Poseidon FTSO,0xD3b3Bd5207687d43c9cCBBbca830dfe2A13EE5b7,NodeID-CtSfUZd8nvr4RDaQnKRiP9cae15Nrb1bX,244

0 commit comments

Comments
 (0)