Skip to content

Conversation

@N-010
Copy link
Contributor

@N-010 N-010 commented Dec 11, 2025

Proposal:
QTF
QRP

N-010 added 22 commits November 8, 2025 21:44
# Conflicts:
#	src/Qubic.vcxproj
#	src/contract_core/contract_def.h
…reserve and don’t consume reseed budget with tier top-ups on k4 rounds

  - test/contract_qtf.cpp: expose private/protected internals for unit tests, add exact-match k2/k3 ticket generators (unique), fund jackpot balance in k4 test, and force FR off in baseline k2/k3 revenue-split test
# Conflicts:
#	src/contract_core/contract_def.h
#	src/contracts/RandomLottery.h
#	test/test.vcxproj
#	test/test.vcxproj.filters
…eserve top-ups; correct schedule bitmask in specx
@N-010 N-010 marked this pull request as ready for review December 19, 2025 12:07

// Number of available smart contracts in the QRP contract.
static constexpr uint16 QRP_AVAILABLE_SC_NUM = 128;
static constexpr uint64 QRP_QTF_INDEX = 21;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a reminder that this index needs to be adapted when merging. There are some more SCs in the pipeline so indices are currently unclear. It becomes especially tricky when we have multiple proposals in one epoch because indices then depend on proposal outcomes.
Maybe it would be best to define this as QRP_CONTRACT_INDEX + 1. This should always be correct assuming QRP and QTF can only be accepted together (=single proposal)?

return;
}

state.availableSmartContracts.remove(id(input.scIndex, 0, 0, 0));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this HashMap needs a call to cleanup or cleanupIfNeeded because it's calling remove (see https://github.com/qubic/core/blob/main/doc/contracts.md#container-types)

{
// Procedures
REGISTER_USER_PROCEDURE(GetReserve, 1);
REGISTER_USER_PROCEDURE(AddAvailableSC, 2);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to you but I suggest to rename *AvailableSC to *AllowedSC. Available reserve makes sense to me but the SCs are either allowed or not.

}
}

public:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is already public (or are you repeating it for easier readability?)


#define _ALLOW_KEYWORD_MACROS 1

#define private protected
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as in the QDuel test, why is this needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants