algorand / go-algorand-sdk

Algorand Golang SDK
https://pkg.go.dev/github.com/algorand/go-algorand-sdk/v2
MIT License
185 stars 95 forks source link

Incentives: Add fields in block header for proposer and fees collected. #617

Closed jannotti closed 4 months ago

jannotti commented 11 months ago

These are needed for https://github.com/algorand/go-algorand/pull/5740 and should not be merged until that work is finalized.

jasonpaulos commented 4 months ago

I'd expect this to also update protocol/config/consensus.go

jannotti commented 4 months ago

I'd expect this to also update protocol/config/consensus.go

Do we just keep them in perfect sync? Is the intent just to make everything available to callers? I can't think of any external functionality that would need access to the params, but I can see why we might have such an exposure policy. (We surely don't have it for any other sdk though)

jasonpaulos commented 4 months ago

We only have it in this SDK for indexer & conduit to consume. There are a few consensus params that they check, such as whether rewards (the old style) are enabled, which influence their behavior/how they report certain things.

The cross repo type check in algod also verifies that the consensus params are in sync.

jannotti commented 4 months ago

I think that's done - it's entirely manual, huh? There was more stuff in consensus.go in go-algorand, plus imports change for the sdk, so I just made the same changes by hand. I guess it would be nice to script it using some mark comments in the source file.

cce commented 4 months ago

the block header is missing AbsentParticipationAccounts

jasonpaulos commented 4 months ago

I think that's done - it's entirely manual, huh?

I thought it was a straight up copy-paste, but now I see the functions LoadConfigurableConsensusProtocols, SetConfigurableConsensusProtocols, and PreloadConfigurableConsensusProtocols from go-algorand are omitted. Perhaps we should move those to their own file so that it really is as simple as copy-paste (except for the "relative" import statement)

jannotti commented 4 months ago

It was unclear to me how that model is used, but I figured I should copy the way expired accounts was done.

a12e954