hashport-validator
hashport-validator copied to clipboard
Collecting validator's fees BE logic
High-level spec link
Example: LimeChain Merkle tree: github & github2
Description:
- Pull of the fees - when the user (validator) want to get the collect the accumulated fees:
- Add a new API to the validator’s current logic.
- The endpoint will receive:
- Validator’s address.
- Network ID.
- Asset’s address (to get the fees for a specific asset).
- Based on the validator's address, the endpoint will return (array per asset):
- The array of signatures from all validators - agreement of the Merkle tree’s root.
- Related to the validator’s node nodes (so the Merkle tree can be built and verified in the Router). Based on the leaf’s index, we will be able to get the intermediate hashes.
- Merkle tree’s root.
- Amount: the fee to be collected.
- Asset’s address and name/symbol.
- Network name and ID.
- If the native token is the HBAR and the wrapped are on EVMs (f.e. Ethereum & Polygon) - skip the Merkle tree logic (do not collect the fees via Merkle tree). There must be a scheduled TX to collect the fees from the Hedera network (locked native assets).
- Once the data is ready > The user (validator) will need to pass it to the Router on the native network.
Subtasks:
- [ ] Collect the data, validation, response: the needed data to be passed to the smart contract
- [ ] unit tests, docks, PR reviews & fixes