Skip to content

Commit

Permalink
Merge branch 'main' into reward-publication-204
Browse files Browse the repository at this point in the history
  • Loading branch information
alenabelium committed Jul 9, 2024
2 parents bce6a21 + 2af75ae commit 5e6605f
Show file tree
Hide file tree
Showing 31 changed files with 183 additions and 508 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ COPY --from=nodemodules /app/node_modules /app/node_modules
COPY . ./

RUN yarn build
RUN yarn build ftso-reward-calculation-process

FROM node:18-slim as runtime

Expand Down
18 changes: 13 additions & 5 deletions apps/ftso-reward-calculation-process/src/libs/claim-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,30 @@ import {
import { fixOffersForRandomFeedSelection } from "../../../../libs/ftso-core/src/reward-calculation/reward-offers";
import { RewardEpochDuration } from "../../../../libs/ftso-core/src/utils/RewardEpochDuration";
import { sleepFor } from "../../../../libs/ftso-core/src/utils/retry";
import { getIncrementalCalculationsTempRewards, serializeIncrementalCalculationsTempRewards } from "../../../../libs/ftso-core/src/utils/stat-info/incremental-calculation-temp-rewards";
import {
getIncrementalCalculationsTempRewards,
serializeIncrementalCalculationsTempRewards,
} from "../../../../libs/ftso-core/src/utils/stat-info/incremental-calculation-temp-rewards";
import { recordProgress } from "../../../../libs/ftso-core/src/utils/stat-info/progress";
import { IncrementalCalculationState } from "../interfaces/IncrementalCalculationState";
import { OptionalCommandOptions } from "../interfaces/OptionalCommandOptions";
import { extractRandomNumbers, processRandomNumberFixingRange } from "./random-number-fixing-utils";

// claims

export function claimAggregation(rewardEpochDuration: RewardEpochDuration, votingRoundId: number, logger: Logger, recordTempIncrementalRewards = false) {
export function claimAggregation(
rewardEpochDuration: RewardEpochDuration,
votingRoundId: number,
logger: Logger,
recordTempIncrementalRewards = false
) {
logger.log(`Aggregating claims for voting round: ${votingRoundId}`);
if (votingRoundId === rewardEpochDuration.startVotingRoundId) {
aggregateRewardClaimsInStorage(rewardEpochDuration.rewardEpochId, votingRoundId, votingRoundId, true);
} else {
aggregateRewardClaimsInStorage(rewardEpochDuration.rewardEpochId, votingRoundId - 1, votingRoundId, false);
}
if(recordTempIncrementalRewards) {
if (recordTempIncrementalRewards) {
const data = getIncrementalCalculationsTempRewards(rewardEpochDuration.rewardEpochId, votingRoundId);
serializeIncrementalCalculationsTempRewards(data);
}
Expand Down Expand Up @@ -99,7 +107,8 @@ export function fixRandomNumbersAndOffers(state: IncrementalCalculationState, lo
randomNumbers
);
logger.log(
`Offers fixed for reward epoch ${state.rewardEpochId + 1
`Offers fixed for reward epoch ${
state.rewardEpochId + 1
} from voting rounds ${lastNextVotingRoundIdWithNoSecureRandom}-${state.nextVotingRoundIdWithNoSecureRandom - 1}.`
);
}
Expand Down Expand Up @@ -132,7 +141,6 @@ export async function calculateAndAggregateRemainingClaims(
logger,
false //options.useFastUpdatesData
);


logger.log(`Claims calculated for voting round ${tmpVotingRoundId}.`);
recordProgress(state.rewardEpochId);
Expand Down
13 changes: 0 additions & 13 deletions apps/ftso-reward-calculator/src/README.md

This file was deleted.

32 changes: 0 additions & 32 deletions apps/ftso-reward-calculator/src/config/configuration.ts

This file was deleted.

This file was deleted.

This file was deleted.

Empty file.
17 changes: 0 additions & 17 deletions apps/ftso-reward-calculator/src/dto/reward-claim.dto.ts

This file was deleted.

37 changes: 0 additions & 37 deletions apps/ftso-reward-calculator/src/ftso-reward-calculator.module.ts

This file was deleted.

8 changes: 0 additions & 8 deletions apps/ftso-reward-calculator/src/main.ts

This file was deleted.

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions apps/ftso-reward-calculator/tsconfig.app.json

This file was deleted.

5 changes: 0 additions & 5 deletions libs/fsp-utils/src/SignaturePayload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ export interface ISignaturePayload {
weight?: number;
}

export interface DepositSignatureData {
message: string;
additionalData: string;
}

export namespace SignaturePayload {
/**
* Encodes signature payload into byte encoding, represented by 0x-prefixed hex string
Expand Down
1 change: 0 additions & 1 deletion libs/ftso-core/src/configs/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ const contracts = () => {
export const CONTRACTS = contracts();

export const ZERO_BYTES32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
export const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";

// State names in indexer database
export const LAST_CHAIN_INDEX_STATE = "last_chain_block";
Expand Down
5 changes: 0 additions & 5 deletions libs/ftso-core/src/orm/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ export class TLPEvents {
block_number: number;
}

export type ITLPTransaction = new () => TLPTransaction;
export type ITLPEvents = new () => TLPEvents;

@Entity("states")
export class TLPState {
@PrimaryColumn()
Expand All @@ -108,5 +105,3 @@ export class TLPState {
@Column({ type: "datetime", precision: 3, nullable: true })
updated: Date = new Date();
}

export type ITPLState = new () => TLPState;
Loading

0 comments on commit 5e6605f

Please sign in to comment.