Skip to content

Next step 4. Active branch #65

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

Merged
merged 86 commits into from
Apr 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
b817de8
Remove clvm_tools_rs to a devDependency WIP
prozacchiwawa Feb 19, 2025
827a986
Use an updated version of clvm_tools_rs, stable constants
prozacchiwawa Feb 20, 2025
43eff58
Clippy, upgrade should be complete
prozacchiwawa Feb 20, 2025
5b8bd87
fmt
prozacchiwawa Feb 20, 2025
7e70916
Add utils
prozacchiwawa Feb 20, 2025
ebdd5fe
Ser/deser for game handler (need to investigate)
prozacchiwawa Feb 20, 2025
840fdbf
fmt
prozacchiwawa Feb 20, 2025
e3c23bd
ProgramRef
prozacchiwawa Feb 20, 2025
89e5ca9
Validation program ref
prozacchiwawa Feb 20, 2025
5b29088
Puzzle
prozacchiwawa Feb 20, 2025
707714f
Fully propogate ProgramRef and Puzzle
prozacchiwawa Feb 20, 2025
933ae12
Shutdown
prozacchiwawa Feb 20, 2025
0233306
update wasm
prozacchiwawa Feb 20, 2025
088d5ef
fix
prozacchiwawa Feb 20, 2025
e8db543
Remove test references to clvm_tools_rs
prozacchiwawa Feb 20, 2025
449e97a
Change versions
prozacchiwawa Feb 20, 2025
4f62d16
Set bson
prozacchiwawa Feb 20, 2025
2d69398
set bson
prozacchiwawa Feb 20, 2025
0750143
Earlier versions
prozacchiwawa Feb 20, 2025
e7e72ff
Bump
prozacchiwawa Feb 20, 2025
0958ef9
Update
prozacchiwawa Feb 20, 2025
20ed74c
Update
prozacchiwawa Feb 20, 2025
91b5c8d
relax
prozacchiwawa Feb 20, 2025
bcb85e5
Try greater version
prozacchiwawa Feb 20, 2025
8e6f050
Up to date everything
prozacchiwawa Feb 20, 2025
a2ad5bc
clean some things up with from traits
prozacchiwawa Feb 20, 2025
23065f8
fmt
prozacchiwawa Feb 20, 2025
09e7478
Merge pull request #72 from Chia-Network/20250219-remove-clvm-tools-r…
prozacchiwawa Feb 20, 2025
f6d614b
Merge up
prozacchiwawa Feb 25, 2025
a25708e
move referee (one step)
prozacchiwawa Feb 28, 2025
ebfffb6
Move types
prozacchiwawa Feb 28, 2025
c606db4
Bifurcating referee
prozacchiwawa Mar 3, 2025
bfe3c79
Fragment src::common::types into many files
richardkiss Mar 3, 2025
e535298
Merge pull request #76 from richardkiss/active
prozacchiwawa Mar 3, 2025
6903637
WIP
prozacchiwawa Mar 3, 2025
6652480
We can make moves
prozacchiwawa Mar 4, 2025
2d9d2d1
Better, we have matching heritage for every move
prozacchiwawa Mar 6, 2025
b28bba2
WIP
prozacchiwawa Mar 6, 2025
5a547ea
More tests passing, stricter assertions
prozacchiwawa Mar 6, 2025
e555cd3
Remove more code from RefereeMaker into the enum container
prozacchiwawa Mar 6, 2025
34816e0
Rest of the code
prozacchiwawa Mar 6, 2025
60ae991
Remove old_ref
prozacchiwawa Mar 6, 2025
ecbe619
remove fixed
prozacchiwawa Mar 6, 2025
7fe8aa1
Move constructor
prozacchiwawa Mar 6, 2025
47a61d3
completely remove old referee
prozacchiwawa Mar 6, 2025
dec06ec
Remove one vestigal mutable
prozacchiwawa Mar 6, 2025
76fdfa9
Fix ref tests
prozacchiwawa Mar 6, 2025
6378618
Remove all remaining mutability
prozacchiwawa Mar 6, 2025
e1822e3
Remove extra box in livegame, hold by rc in RefereeByTurn, elide copi…
prozacchiwawa Mar 6, 2025
cdc9d99
Fragment src::channel_handler::types into many files
richardkiss Mar 6, 2025
4d430c2
Merge pull request #79 from richardkiss/channel_handler_types
prozacchiwawa Mar 7, 2025
78346f5
Merge up richard's work and remove most clippy traffic
prozacchiwawa Mar 7, 2025
8adbef5
fmt
prozacchiwawa Mar 7, 2025
db5a13b
Change names to match new diagram
prozacchiwawa Mar 10, 2025
074646d
Made the biggest part of this conceptual change, renaming validation …
prozacchiwawa Mar 16, 2025
2d7aacd
Rename more validator to state update, start removing and juggling va…
prozacchiwawa Mar 16, 2025
9c5bea1
Improvement: i think i understand everything. happily, we have obvio…
prozacchiwawa Mar 17, 2025
0d680ef
Better. We now have proper alignment with the ending args (XXX, need…
prozacchiwawa Mar 19, 2025
e4aea95
Zero zero zero destruct zero
prozacchiwawa Mar 21, 2025
9091f5c
Fixed up calpoker e handling
bramcohen Mar 21, 2025
26495e5
Merge remote-tracking branch 'upstream/20250307-state-from-validation…
prozacchiwawa Mar 21, 2025
b7a9312
Compiling
prozacchiwawa Mar 21, 2025
983d3f6
Ok, better but still broken. We need to ensure we're getting the rig…
prozacchiwawa Mar 22, 2025
71864dd
Ensure state is just what's needed
prozacchiwawa Mar 22, 2025
be2f6c9
One passing test
prozacchiwawa Mar 22, 2025
e6ffeb0
Bug fixes and cleanup
bramcohen Mar 22, 2025
28f1f58
merged
bramcohen Mar 22, 2025
6d23736
Bob wins, bob paid
prozacchiwawa Mar 22, 2025
6dc5d34
Updates
prozacchiwawa Mar 25, 2025
ad8217d
Whew
prozacchiwawa Mar 25, 2025
2133954
fix
prozacchiwawa Mar 25, 2025
dfe701d
Add diagnostic point in message handler
prozacchiwawa Mar 26, 2025
654a341
wip
aqk Apr 11, 2025
21da457
wip
aqk Apr 11, 2025
40c95c7
wip debug: check Program.to() conversions
aqk Apr 12, 2025
536bde8
Move pytests dir, and fix paths
aqk Apr 14, 2025
ff877f9
Remove temp files
aqk Apr 14, 2025
b369790
Add a parallel test file for the moment. we'll figure out how to mer…
prozacchiwawa Apr 14, 2025
1bb4386
Remove unintended
prozacchiwawa Apr 14, 2025
cf67bae
Revert my unintended changes to active
prozacchiwawa Apr 14, 2025
0522d36
Revert one more
prozacchiwawa Apr 14, 2025
39fdd60
fmt
prozacchiwawa Apr 15, 2025
f2bff74
Revert more
prozacchiwawa Apr 15, 2025
e5f95e9
fmt
prozacchiwawa Apr 15, 2025
58ff0ad
re-add
prozacchiwawa Apr 15, 2025
ec85a6f
clippy
prozacchiwawa Apr 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
511 changes: 275 additions & 236 deletions Cargo.lock

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,20 @@ server = ["dep:tokio","dep:salvo","dep:exec"]
used_linker = []

[dependencies]
clvm_tools_rs = { git = "https://github.com/Chia-Network/clvm_tools_rs.git", rev = "ec75759377791c9b785123d2d3e2457d08ac6621" }
clvmr = { version = "=0.3.2", features = ["pre-eval"] }
clvmr = { version = "=0.12.0", features = ["pre-eval"] }
serde_json = "1.0"
rand = "0.8.5"
rand_chacha = "0.3.1"
clvm-traits = "0.7.0"
clvm-traits = "0.20.0"
blst = "=0.3.13"
subtle = "2.5.0"
num-bigint = "0.4.4"
num-traits = "0.2.15"
chia-bls = "=0.9.0"
clvm-utils = "0.7.0"
clvm-utils = "0.20.0"
lazy_static = "1.4.0"
ff = { version = "0.13.0", features = ["derive"] }
bson = "2.11.0"
bson = "2.13.0"
sha2 = "0.10.8"
indoc = "2.0.5"
serde = "1.0.203"
Expand All @@ -46,8 +45,8 @@ exec = "0.3.1"
[build-dependencies]
serde = "1.0.203"
toml = "0.8.14"
clvm_tools_rs = { git = "https://github.com/Chia-Network/clvm_tools_rs.git", rev = "ec75759377791c9b785123d2d3e2457d08ac6621" }
clvmr = { version = "=0.3.2", features = ["pre-eval"] }
clvm_tools_rs = { git = "https://github.com/Chia-Network/clvm_tools_rs.git", rev = "f5f6ebd339b4782d9b3c65db8796af554d341bd8" }
clvmr = { version = "=0.12.0", features = ["pre-eval"] }

[lib]
name = "chia_gaming"
Expand Down
18 changes: 10 additions & 8 deletions src/channel_handler/game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::rc::Rc;
use clvm_traits::{ClvmEncoder, ToClvm};
use clvmr::run_program;

use clvm_tools_rs::classic::clvm::sexp::proper_list;
use crate::utils::proper_list;

use log::debug;

Expand Down Expand Up @@ -36,7 +36,9 @@ impl Game {
game_hex_file: &str,
) -> Result<Game, Error> {
let poker_generator = read_hex_puzzle(allocator, game_hex_file)?;
let nil = allocator.encode_atom(&[]).into_gen()?;
let nil = allocator
.encode_atom(clvm_traits::Atom::Borrowed(&[]))
.into_gen()?;
let poker_generator_clvm = poker_generator.to_clvm(allocator).into_gen()?;
debug!("running start");
let template_clvm = run_program(
Expand Down Expand Up @@ -72,17 +74,17 @@ impl Game {
.expect("should be an atom");
let required_size_factor = Amount::new(
atom_from_clvm(allocator, template_list[3])
.and_then(u64_from_atom)
.and_then(|a| u64_from_atom(&a))
.expect("should be an atom"),
);
let initial_max_move_size = atom_from_clvm(allocator, template_list[4])
.and_then(usize_from_atom)
.and_then(|a| usize_from_atom(&a))
.expect("should be an atom");
let validation_prog = Rc::new(Program::from_nodeptr(allocator, template_list[5])?);
let initial_validation_program = ValidationProgram::new(allocator, validation_prog);
let initial_validation_program_hash =
if let Some(a) = atom_from_clvm(allocator, template_list[6]) {
Hash::from_slice(a)
Hash::from_slice(&a)
} else {
return Err(Error::StrErr(
"not an atom for initial_validation_hash".to_string(),
Expand All @@ -91,7 +93,7 @@ impl Game {
let initial_state_node = template_list[7];
let initial_state = Rc::new(Program::from_nodeptr(allocator, initial_state_node)?);
let initial_mover_share_proportion = atom_from_clvm(allocator, template_list[8])
.and_then(usize_from_atom)
.and_then(|a| usize_from_atom(&a))
.expect("should be an atom");
Ok(Game {
id: game_id,
Expand Down Expand Up @@ -130,7 +132,7 @@ impl Game {
my_contribution_this_game: our_contribution.clone(),
their_contribution_this_game: their_contribution.clone(),
initial_validation_program: self.initial_validation_program.clone(),
initial_state: self.initial_state.clone(),
initial_state: self.initial_state.clone().into(),
initial_move: vec![],
initial_max_move_size: self.initial_max_move_size,
initial_mover_share: mover_share,
Expand All @@ -143,7 +145,7 @@ impl Game {
my_contribution_this_game: their_contribution.clone(),
their_contribution_this_game: our_contribution.clone(),
initial_validation_program: self.initial_validation_program.clone(),
initial_state: self.initial_state.clone(),
initial_state: self.initial_state.clone().into(),
initial_move: vec![],
initial_max_move_size: self.initial_max_move_size,
initial_mover_share: waiter_share,
Expand Down
Loading
Loading