-
Notifications
You must be signed in to change notification settings - Fork 1
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
Remove cardano net and remove unecessary network settings #65
base: main
Are you sure you want to change the base?
Conversation
todo!(); | ||
}; | ||
|
||
let (slot, hash) = match raw_header.variant { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rooooooooob I was wondering if it would make sense to have this logic be in CML somehow? Or if there is already a way of writing this that I didn't think about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have part of this code in the MultiEraBlock::hash()
(in multi_era/rust/src/utils.rs
) for the hash part, but not the slot/difficulty part.
I guess this might not be relevant though since you'd need the whole block not just the header though. It's not a huge amount of code so it could be fine to just duplicate it here or we could expose just the header part.
blockchain-source/src/cardano/mod.rs
Outdated
}, | ||
} | ||
} else { | ||
todo!(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo?
"preprod" => dcspark_blockchain_source::cardano::NetworkConfiguration::preprod(), | ||
"preview" => dcspark_blockchain_source::cardano::NetworkConfiguration::preview(), | ||
"sancho" => dcspark_blockchain_source::cardano::NetworkConfiguration::sancho(), | ||
_ => return Err(anyhow::anyhow!("network not supported by source")), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
won't this break for localhost?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just a testing tool, it's just designed as a quick way to get blocks to test deserialization (without having to sync the entire chain with carp), at least that was the purpose of the original oura fetcher, which this replaces.
This PR replaces the cardano-net crate por pallas-network.
There are 2 reasons for this:
Point::Origin
to the blockfetch protocol, so we needed to know the first block (and the fact that we wanted the first block). But now this is replaced by using the RequestNext message, which gives us the first block. This is especially useful to setup custom networks, since getting the first block data is otherwise an annoying extra step that requires some form of extra indexer.Besides the above, this PR makes the Era settings optional, in which case the epochs are not computed. We need to have the setting for Milkomeda, since we don't parse the entire chain there, so we can't know when shelley started, but in carp we can figure this out (although it has some tricky parts). This is mostly (again) done to simplify using carp with new networks.
Also, the
from
setting is made optional. This is still needed for some internal reasons (the interaction with the multiverse), but we should be able to remove it eventually.There is however some follow up work that this PR doesn't cover: