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)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you. I'll do that

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Done

{
// 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Renamed

}
}

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?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

Auto-update QTF index in QRP
Adds cleanup for allowedSmartContracts in QRP
Copy link
Collaborator

@Franziska-Mueller Franziska-Mueller left a comment

Choose a reason for hiding this comment

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

Please merge develop and fix the contract indices in contract_def.h.
You can decide in which epoch the proposals for QDuel and QThirtyFour/QReservePool should happen and adapt the indices accordingly.

static constexpr uint8 toReturnCode(const EReturnCode& code) { return static_cast<uint8>(code); };

public:
// Get Reserve
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: the comment still says "Get Reserve"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

# Conflicts:
#	src/contract_core/contract_def.h
# Conflicts:
#	src/contract_core/contract_def.h
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