Skip to content
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

feat(platform)!: contested document resolution with masternode voting #1878

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e7bfefa
chore: temp squash of masternode voting into higher branch (#1877)
QuantumExplorer Jun 11, 2024
c000f54
chore: autogenerated grpc code
QuantumExplorer Jun 11, 2024
5ffed4b
fix(drive): contested document resolution with masternode voting batc…
QuantumExplorer Jun 11, 2024
2d30333
chore: renamed back vote_choices to votes on places where it had been…
QuantumExplorer Jun 11, 2024
3193aaf
chore: validate that contested index is unique (#1881)
shumkov Jun 11, 2024
316db6e
fix: added description keyword to schema for contested index
QuantumExplorer Jun 11, 2024
566b350
feat: contender serialization (#1882)
QuantumExplorer Jun 12, 2024
5f287ac
fix: cleanup fix and remove identitiesIdsOnly Vote State query (#1890)
QuantumExplorer Jun 14, 2024
9919a8f
feat(sdk)!: impl Fetch/FetchMany for masternode voting endpoints (#1864)
lklimek Jun 14, 2024
4dd34e2
fix: small fix for test: test_document_creation_on_contested_unique_i…
QuantumExplorer Jun 16, 2024
6ce465d
fix: contested unique indexes can only be on non mutable document typ…
QuantumExplorer Jun 17, 2024
42d8573
fix: build broken after merge of contested unique indexes validation …
lklimek Jun 17, 2024
ff4f81b
feat: remove votes of removed masternodes when collateral is moved (#…
QuantumExplorer Jun 18, 2024
a75ca37
fix: contested resources query fixes (#1896)
QuantumExplorer Jun 18, 2024
966f29f
fix: sum tree verification with specialized balances (#1899)
QuantumExplorer Jun 20, 2024
69134e4
test(sdk): masternode voting SDK tests (#1893)
lklimek Jun 23, 2024
366ad2c
make vote module public
pauldelucia Jun 24, 2024
467bfa7
fix: contested document resolution fixes 2 and improvement to mastern…
QuantumExplorer Jun 25, 2024
b33eb5a
fix: voting proofs work as intended and various fixes (#1910)
QuantumExplorer Jun 28, 2024
ccde6af
fix(sdk): state transition broadcast missing contract provider (#1913)
lklimek Jun 30, 2024
245dc46
fix: incorrect proofs are returned for various state transitions (#1912)
shumkov Jul 1, 2024
5857b9e
fix: Abstain and Lock trees for votes are now always first and fixed …
QuantumExplorer Jul 2, 2024
c6f338c
fix(drive): add validation that an identity can not apply to be a con…
QuantumExplorer Jul 4, 2024
4f71941
test(sdk): increase test coverage of masternode voting (#1906)
lklimek Jul 4, 2024
28c2c68
Merge branch 'v1.0-dev' into feat/contestedDocumentResolutionWithMast…
QuantumExplorer Jul 4, 2024
31734d8
fix: fixed voting strategy tests and cleanup
QuantumExplorer Jul 4, 2024
bedcde3
feat(sdk): support mocking of error responses (#1926)
lklimek Jul 4, 2024
9ee1eae
fix: minor issues detected by github actions (#1928)
lklimek Jul 5, 2024
372a801
test(sdk): regenerate test vectors for masternode voting (#1927)
lklimek Jul 5, 2024
239371c
test(sdk): disable failing tests for bugs scheduled for future (#1930)
lklimek Jul 5, 2024
8a2216f
test: fix documentTransition.hasPrefundedBalance is not a function (#…
shumkov Jul 6, 2024
61058c5
Merge branch 'v1.0-dev' into feat/contestedDocumentResolutionWithMast…
QuantumExplorer Jul 6, 2024
31029b5
chore: update masternode voting tests after merging in v1
QuantumExplorer Jul 6, 2024
c42b871
Merge branch 'feat/contestedDocumentResolutionWithMasternodeVoting' o…
QuantumExplorer Jul 6, 2024
21b903e
fix: final clean up and fixing of contested resource voting PR
QuantumExplorer Jul 6, 2024
b1b3734
fix: duplicate fields defined in DPNS contract
shumkov Jul 8, 2024
0effb07
feat(platform)!: proofs v1 support (#1934)
QuantumExplorer Jul 9, 2024
92303ad
Merge branch 'refs/heads/v1.0-dev' into feat/contestedDocumentResolut…
shumkov Jul 9, 2024
85faf50
chore: update Cargo lock
shumkov Jul 9, 2024
eca0a1e
style(drive): update formatting
shumkov Jul 9, 2024
76a9a00
test: temporary skip withdrawal tests
shumkov Jul 9, 2024
0e29160
chore: update to latest GroveDB (Proofs v1)
QuantumExplorer Jul 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1,135 changes: 667 additions & 468 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ WORKDIR /platform

COPY . .

# Workaround: as we cache dapi-grpc, its build.rs is not rerun, so we need to touch it
RUN touch /platform/packages/dapi-grpc/build.rs

#
# STAGE: BUILD RS-DRIVE-ABCI
#
Expand Down
21 changes: 12 additions & 9 deletions packages/check-features/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ use toml::Value;

fn main() {
let crates = [
"rs-sdk",
"rs-drive-abci",
"rs-dpp",
"rs-drive",
"rs-drive-proof-verifier",
("rs-sdk", vec![]),
("rs-drive-abci", vec![]),
("rs-dpp", vec!["documents-faker"]),
("rs-drive", vec![]),
("rs-drive-proof-verifier", vec![]),
];

for specific_crate in crates {
check_crate(specific_crate)
for (specific_crate, to_ignore) in crates {
check_crate(specific_crate, to_ignore)
}
}

fn check_crate(crate_name: &str) {
fn check_crate(crate_name: &str, to_ignore: Vec<&str>) {
// Construct the path to the Cargo.toml file for each crate
let cargo_toml_path = format!("packages/{}/Cargo.toml", crate_name);

Expand Down Expand Up @@ -77,7 +77,10 @@ fn check_crate(crate_name: &str) {

for (feature, _) in features.as_table().unwrap().iter() {
// Skip special feature groups
if feature == "default" || feature.ends_with("features") {
if feature == "default"
|| feature.ends_with("features")
|| to_ignore.contains(&feature.as_str())
{
continue;
}

Expand Down
4 changes: 3 additions & 1 deletion packages/dapi-grpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ tonic = { version = "0.11", features = [
serde = { version = "1.0.197", optional = true, features = ["derive"] }
serde_bytes = { version = "0.11.12", optional = true }
serde_json = { version = "1.0", optional = true }
tenderdash-proto = { git = "https://github.com/dashpay/rs-tenderdash-abci", version = "1.0.0", tag = "v1.0.0", default-features = false }
tenderdash-proto = { git = "https://github.com/dashpay/rs-tenderdash-abci", version = "1.0.0", tag = "v1.0.0", default-features = false, features = [
"grpc",
] }
dapi-grpc-macros = { path = "../rs-dapi-grpc-macros" }
platform-version = { path = "../rs-platform-version" }

Expand Down
42 changes: 40 additions & 2 deletions packages/dapi-grpc/build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::{
collections::HashSet,
fs::{create_dir_all, remove_dir_all},
path::PathBuf,
process::exit,
Expand Down Expand Up @@ -46,7 +47,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
// Derive features for versioned messages
//
// "GetConsensusParamsRequest" is excluded as this message does not support proofs
const VERSIONED_REQUESTS: [&str; 19] = [
const VERSIONED_REQUESTS: [&str; 25] = [
"GetDataContractHistoryRequest",
"GetDataContractRequest",
"GetDataContractsRequest",
Expand All @@ -66,10 +67,16 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
"GetProtocolVersionUpgradeVoteStatusRequest",
"GetPathElementsRequest",
"GetIdentitiesContractKeysRequest",
"GetPrefundedSpecializedBalanceRequest",
"GetContestedResourcesRequest",
"GetContestedResourceVoteStateRequest",
"GetContestedResourceVotersForIdentityRequest",
"GetContestedResourceIdentityVotesRequest",
"GetVotePollsByEndDateRequest",
];

// "GetConsensusParamsResponse" is excluded as this message does not support proofs
const VERSIONED_RESPONSES: [&str; 20] = [
const VERSIONED_RESPONSES: [&str; 26] = [
"GetDataContractHistoryResponse",
"GetDataContractResponse",
"GetDataContractsResponse",
Expand All @@ -90,8 +97,17 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
"GetProtocolVersionUpgradeVoteStatusResponse",
"GetPathElementsResponse",
"GetIdentitiesContractKeysResponse",
"GetPrefundedSpecializedBalanceResponse",
"GetContestedResourcesResponse",
"GetContestedResourceVoteStateResponse",
"GetContestedResourceVotersForIdentityResponse",
"GetContestedResourceIdentityVotesResponse",
"GetVotePollsByEndDateResponse",
];

check_unique(&VERSIONED_REQUESTS).expect("VERSIONED_REQUESTS");
check_unique(&VERSIONED_RESPONSES).expect("VERSIONED_RESPONSES");

// Derive VersionedGrpcMessage on requests
for msg in VERSIONED_REQUESTS {
platform = platform
Expand Down Expand Up @@ -146,6 +162,28 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
platform
}

/// Check for duplicate messages in the list.
fn check_unique(messages: &[&'static str]) -> Result<(), String> {
let mut hashset: HashSet<&'static str> = HashSet::new();
let mut duplicates = String::new();

for value in messages {
if !hashset.insert(*value) {
duplicates.push_str(value);
duplicates.push_str(", ");
}
}

if duplicates.is_empty() {
Ok(())
} else {
Err(format!(
"Duplicate messages found: {}",
duplicates.trim_end_matches(", ")
))
}
}

fn configure_core(core: MappingConfig) -> MappingConfig {
// All messages can be mocked.
let core = core.message_attribute(".", r#"#[derive(::dapi_grpc_macros::Mockable)]"#);
Expand Down
Loading
Loading