0xEcd003160088F28eaC6A008ad4B64FF6ec20369C - #676
Conversation
Co-authored-by: NathanBSC <122502194+NathanBSC@users.noreply.github.com>
Co-authored-by: NathanBSC <122502194+NathanBSC@users.noreply.github.com>
…n#659) * chore: update generate script for testnet * fix: ci check for compare bytecodes * feat: modify LOCK_PERIOD_FOR_TOKEN_RECOVER to 300 second * feat: sync testnet genesis * stakehub: reject rotated consensus keys in bep563 auth --------- Co-authored-by: zoro <296179868@qq.com> Co-authored-by: Ethan <cosinlinker@gmail.com> Co-authored-by: Roshan <luoshen1997@gmail.com> Co-authored-by: buddho <galaxystroller@gmail.com> Co-authored-by: zzzckck <152148891+zzzckck@users.noreply.github.com> Co-authored-by: buddho <7995985+buddh0@users.noreply.github.com>
…26-950) (bnb-chain#667) BSCGovernor._castVote was gated only by notInBlackList, which checks msg.sender. The inherited OZ castVoteBySig / castVoteWithReasonAndParamsBySig recover the voter from the EIP-712 signature and call _castVote with that recovered address as `account`, while msg.sender is the relayer. A blacklisted voter could therefore have a clean relayer submit its signed ballot and vote with its full weight, bypassing the per-address governance freeze. Add an explicit check on the recovered voter (`account`) inside _castVote, the single chokepoint all vote entrypoints funnel through. Direct castVote is unaffected (account == msg.sender); clean relayed votes still succeed. Adds GovernorBlacklistBySig.t.sol regression coverage (runs under CI's archive-fork environment). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rotation (bnb-chain#664) * fix: felony-cross-call consistency * fix: felony-cross-call consistency * test: adapt unit tests to mainnet turnLength and slash threshold changes Mainnet governance changed parameters that the fork-based tests read from live state: turnLength 16 -> 8, misdemeanorThreshold 200 -> 333 and felonyThreshold 600 -> 1000 (raised after the block interval dropped to ~0.45s), which made the hardcoded assertions fail. - ValidatorSet.t.sol: expect getTurnLength() == 8 - SlashIndicator.t.sol: bump MISDEMEANOR_THRESHOLD/FELONY_THRESHOLD to 333/1000 - SlashIndicator.t.sol: derive the testMisdemeanor re-slash loop bound from the live post-clean count instead of a hardcoded number, so it no longer needs retuning when thresholds change Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * test: add regression for felony cross-call after consensus-key rotation Covers the window the PR fixes: once a validator rotates its consensus key and the active set has synced K_new, the double-sign evidence still carries K_old, so SlashIndicator.felony(K_old) is a no-op. The eviction must come from StakeHub.doubleSignSlash -> felony(valInfo.consensusAddress = K_new); without it the slashed+jailed validator would remain in the active set. Verified against a BSC mainnet fork. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * test: adapt Governor test to mainnet votingPeriod/lateQuorum changes testProposeQuorumReached recomputed the expected voting period from a fixed BLOCK_INTERVAL (3s), which drifted out of date after mainnet retuned the governor for the ~0.45s block interval (votingPeriod 806400 -> 1344000, lateQuorumVoteExtension 115200 -> 172800). Read the live values from the governor instead so the assertions track the on-chain params. Verified against a BSC mainnet fork. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * ci: fork archive node for unit tests to fix missing-trie-node The CI forked bsc-dataseed (non-archive), which only retains ~128 recent blocks of state. After the block interval dropped to ~0.45s that window shrank to ~57s, so the forked block's state was pruned mid-run and tests failed with "missing trie node". Fork an archive endpoint (secrets.ARCHIVE_RPC) instead, which retains historical state for the whole run. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…chain#668) * chore: regenerate genesis bytecode for StakeHub and BSCGovernor Sync the committed genesis (mainnet/testnet/dev) with the current contracts. StakeHub changed in bnb-chain#664 (propagate slash eviction to BSCValidatorSet after consensus-key rotation) and BSCGovernor in bnb-chain#667 (reject blacklisted voter on castVoteBySig), but the genesis bytecode was not regenerated, so check-genesis diffed. Only the 0x2002 (StakeHub) and 0x2004 (BSCGovernor) code entries change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * ci: pin foundry to v1.2.1 in check-genesis check-genesis installed an unpinned (latest) foundry, whose `forge install --no-git forge-std@v1.7.3` fails on forge-std's nested ds-test submodule ("not a git repository: ../../.git/modules/lib/ds-test"), so the job died before ever reaching the genesis bytecode comparison. Pin v1.2.1 to match unit-test.yml, which installs the same dependency cleanly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
chore: merge develop into master for Pasteur hardfork
Pull Request ReviewThis PR primarily hardens CI/workflow security and updates dependency usage in GitHub Actions (moving from Sensitive ContentBlockchain Address:
Security IssuesNo serious security issues detected. Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits. |
Fahhd1400
left a comment
There was a problem hiding this comment.
0xecd003160088f28eac6a008ad4b64ff6ec20369c
0xecd003160088f28eac6a008ad4b64ff6ec20369c
Pull Request ReviewThis PR hardens CI workflows and smart-contract logic while updating tests and genesis configuration. It modernizes GitHub Actions usage (new action versions, npm cache, pinned action commit, secret-based RPC endpoint), and significantly improves the Sensitive ContentBlockchain Address:
Security IssuesNo serious security issues detected. Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits. |
add a description of your changes here...
Rationale
tell us why we need these changes...
Example
add an example CLI or API response...
Changes
Notable changes: