Skip to content

Conversation

@mkysel
Copy link
Collaborator

@mkysel mkysel commented Aug 27, 2025

Add set-pause and get-pause CLI commands and implement blockchain.IAppChainAdmin pause getters/setters to pause or unpause identity update and group message broadcasters in appchain contracts

  • Add set-pause and get-pause command handling, option parsing, and execution paths in main.go, including new CLI fields and setPause/getPause functions.
  • Introduce Target, SetPauseOptions, and GetPauseOptions in cliOptions.go with flag validation for --target and --paused.
  • Extend blockchain.IAppChainAdmin and implement GetGroupMessagePauseStatus, SetGroupMessagePauseStatus, GetIdentityUpdatePauseStatus, and SetIdentityUpdatePauseStatus in appchainAdmin.go, updating on-chain parameters and invoking broadcaster UpdatePauseStatus, treating error 0xa88ee577 as a no-op.
  • Add boolean parameter support in parameterAdmin.go with IDENTITY_UPDATE_PAUSED_KEY, GROUP_MESSAGE_PAUSED_KEY, GetParameterBool, SetBoolParameter, and helpers packBool/decodeBool.
  • Add tests covering pause flows and boolean parameters in appchainAdmin_test.go and parameterAdmin_test.go.

📍Where to Start

Start with the CLI command wiring in parseOptions and the setPause/getPause paths in main.go.


Macroscope summarized 5f1f336.

@mkysel mkysel requested a review from a team as a code owner August 27, 2025 16:48
@graphite-app
Copy link

graphite-app bot commented Aug 27, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • Queue - adds this PR to the back of the merge queue
  • Hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.


// decodeBool expects the canonical encoding produced by packBool.
// It returns (bool, nil) for 0x00/0x01 in the last byte and errors otherwise.
func decodeBool(val [32]byte) (bool, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't use the geth abi encoding for this stuff?

Something like:

typ, _ := abi.NewType("bool", "", nil)
args := abi.Arguments{{Type: typ}}
packed, _ := args.Pack(true)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

func packBoolABI(b bool) ([32]byte, error) {
	var out [32]byte
	t, err := abi.NewType("bool", "", nil)
	if err != nil { return out, err }
	args := abi.Arguments{{Type: t}}
	data, err := args.Pack(b) // 32 bytes for single bool
	if err != nil { return out, err }
	copy(out[:], data)
	return out, nil
}
func unpackBoolABI(word [32]byte) (bool, error) {
	t, err := abi.NewType("bool", "", nil)
	if err != nil { return false, err }
	args := abi.Arguments{{Type: t}}
	vs, err := args.Unpack(word[:]) // returns []interface{}{bool}
	if err != nil { return false, err }
	return vs[0].(bool), nil
}

I feel like its even worse than the existing code :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough

@mkysel mkysel merged commit ebf7feb into main Aug 27, 2025
10 checks passed
@mkysel mkysel deleted the mkysel/cli3 branch August 27, 2025 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants