Chia-Network / pool-reference

Reference python implementation of Chia pool operations for pool operators
Apache License 2.0
440 stars 197 forks source link

Doesn't compile with Chia 2.3.0 #296

Open Ealrann opened 1 month ago

Ealrann commented 1 month ago

Hello,

The reference pool doesn't compile anymore with the last version of chia (2.3.0) because the chia.types.Announcement no longer exists.

It's used in the create_absorb_transaction method in singleton.py. I tried to simply remove the announcements, and directly pass the coin list in create_signed_transaction, but the pool claim then fail with an error ("No key for puzzle hash", I attach the log).

Any hint how to fix the singleton.py for chia 2.3.0?

err.txt

djerfy commented 3 weeks ago

Hi @mariano54, @aqk,

Quick question on an update pool from 2.1.x to 2.3.x

In this code, need to replace Announcement by CreateCoinAccouncement?

transaction = await wallet['rpc_client'].create_signed_transaction(
            additions=[{'puzzle_hash': wallet['puzzle_hash'], 'amount': 0}],
            tx_config=DEFAULT_TX_CONFIG,
            coins=[spend_coin],
            coin_announcements=[Announcement(p2_coin.name(), b"$")],
            fee=uint64(1),
)

Same here?

transaction = await wallet['rpc_client'].create_signed_transaction(
            additions=[{'puzzle_hash': wallet['puzzle_hash'], 'amount': spend_coin.amount - fee}],
            tx_config=DEFAULT_TX_CONFIG,
            coins=[spend_coin],
            coin_announcements=[Announcement(p2_coin.name(), b"$")],
            fee=uint64(fee),
)

And here, it's AssertCoinAnnouncement?

solution: Program = w.make_solution(
        primaries=primaries,
        coin_announcements={message},
        fee=fee,
        coin_announcements_to_assert={Announcement(p2_coin.name(), bytes(b"$")).name()},
)

Thanks