-
Notifications
You must be signed in to change notification settings - Fork 273
feat: add NeuronRegistrationBurn event for tracking alpha burned #2323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devnet-ready
Are you sure you want to change the base?
feat: add NeuronRegistrationBurn event for tracking alpha burned #2323
Conversation
|
@open-junius would you review this PR? |
|
Adds a new event `NeuronRegistrationBurn` that is emitted during burned registration to track the exact amount of alpha that was burned. The event includes: - netuid: The subnet where registration occurred - hotkey: The registered hotkey - tao_cost: The TAO amount that was spent - alpha_burned: The alpha amount that was actually burned This enables accurate tracking of registration burn amounts for accounting and analytics purposes. Fixes opentensor#2104
- Added new event NeuronRegistrationBurn(NetUid, AccountId, TaoCurrency, AlphaCurrency) - Emitted during do_burned_registration to track actual alpha burned - Bumped spec_version to 366 for devnet-ready Fixes opentensor#2104
86e342a to
adbb6eb
Compare
Instead of creating a separate NeuronRegistrationBurn event, expanded the existing NeuronRegistered event to include the burn amounts: - NeuronRegistered(NetUid, u16, T::AccountId, TaoCurrency, AlphaCurrency) For POW and root registration (which don't burn), tao_cost and alpha_burned are 0. Fixes opentensor#2104
|
@open-junius Good suggestion I've updated the PR to expand the existing NeuronRegistered(NetUid, u16, T::AccountId, TaoCurrency, AlphaCurrency)For POW and root registration (which don't burn), tao_cost and alpha_burned are set to 0. |
|
@open-junius Updated I've expanded the existing NeuronRegistered(NetUid, u16, T::AccountId, TaoCurrency, AlphaCurrency)For POW and root registration (which don't burn), the values are set to 0. |
Summary
Adds a new event
NeuronRegistrationBurnthat is emitted during burned registration to enable accurate tracking of the alpha amount that was burned.Problem
Currently, it's impossible to calculate how much alpha was burned by neuron registration (as noted in #2104). This makes accurate balance bookkeeping and analytics difficult.
Solution
Added a new event
NeuronRegistrationBurn(NetUid, T::AccountId, TaoCurrency, AlphaCurrency)that includes:netuid: The subnet where registration occurredhotkey: The registered hotkeytao_cost: The TAO amount that was spentalpha_burned: The alpha amount that was actually burnedThe event is emitted alongside the existing
NeuronRegisteredevent duringdo_burned_registration.Changes
pallets/subtensor/src/macros/events.rs: Added newNeuronRegistrationBurnevent definitionpallets/subtensor/src/subnets/registration.rs: Emit the new event with burn amountsTest plan
cargo check --libpassescargo check --testspassesFixes #2104