Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Conversation

@jflatow
Copy link
Contributor

@jflatow jflatow commented Jul 6, 2021

No description provided.

@jflatow
Copy link
Contributor Author

jflatow commented Jul 6, 2021

Not at all clear how we're supposed to get a <T: Config> to an InherentDataProvider, and overall quite ugly 😞

@jflatow jflatow force-pushed the jflatow/pin-miner branch from f3b3d30 to 905908a Compare July 6, 2021 22:12
@jflatow jflatow changed the title Replace miner env var with 'current validator' gateway address [COMP-1277] Replace miner env var with 'current validator' gateway address Jul 6, 2021
@linear
Copy link

linear bot commented Jul 6, 2021

COMP-1277 Distribute to Substrate ID instead of separate miner address

We wanted to kill the runtime interfaces as well as simplify setup for validators by paying to the Gate: address for the validator instead of their given env variable.

This will also help subscan track validator earnings.

@github-actions

This comment has been minimized.

@github-actions
Copy link

github-actions bot commented Jul 6, 2021

🫖 [View Integration Test Results](server error: invalid xunit xml)

@github-actions
Copy link

github-actions bot commented Jul 6, 2021

Unit Test Results

0 files  ±0  0 suites  ±0   0s ⏱️ ±0s
0 tests ±0  0 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 905908a. ± Comparison against base commit ed0b0fe.

Comment on lines +103 to 104
// XXX how can we pass a <T: Config>??
let miner = pallet_cash::internal::miner::InherentDataProvider {};
Copy link

Choose a reason for hiding this comment

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

in principal you can depend on the gateway-runtime::Runtime struct and pass it to the generic here, that binds your node impl to a particular (set of) runtime version(s) though

.map_err(|_| sp_inherents::Error::Application(Box::from("invalid miner address")))?;

inherent_data.put_data(INHERENT_IDENTIFIER, &chain_account)
let validator = core::get_current_validator::<T>()
Copy link

Choose a reason for hiding this comment

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

this is a function accessing runtime storage I assume?
I think you'll need to introduce a runtime api that allows you to access that data (and that doesn't depend on a <T: Config>) similar to e.g. the GrandpaApi here: https://github.com/paritytech/substrate/blob/4e75f511e1357cf54c31d9e82d0cf3e39a2b8c28/bin/node/runtime/src/lib.rs#L1307

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants