-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Phase-1 stake ingesting - RFC15 (#265)
Implement: - allow list that will expire at certain Babylon block - upgrade to insert allowed transactions hashes - modification in message handler to use allow list under certain Babylon height i.e approach 4, from [RFC-15](https://github.com/babylonlabs-io/pm/blob/main/rfc/rfc-015-moderate-intake-of-phase-1-stake.md#4-fixed-list-of-allowed-transactions-with-parameter-how-long-to-keep-the-allow-list) Rationale for putting allowlist expiration height in params: - if we discover some problems during initial blocks of phase-2, we may extend the periond when allow list is used - we should be able to disable allow list for testnet (setting expiration height to `0` disable allow list)
- Loading branch information
1 parent
dd4009d
commit 50e9a23
Showing
25 changed files
with
446 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package v1_test | ||
|
||
import ( | ||
"testing" | ||
|
||
v1 "github.com/babylonlabs-io/babylon/app/upgrades/v1" | ||
"github.com/btcsuite/btcd/chaincfg/chainhash" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestLoadAllowedStakingTxHashesFromData(t *testing.T) { | ||
for _, upgradeData := range UpgradeV1Data { | ||
d, err := v1.LoadAllowedStakingTransactionHashesFromData(upgradeData.AllowedStakingTxHashesStr) | ||
require.NoError(t, err) | ||
require.NotNil(t, d) | ||
require.Greater(t, len(d.TxHashes), 0) | ||
|
||
for _, txHash := range d.TxHashes { | ||
_, err := chainhash.NewHashFromStr(txHash) | ||
require.NoError(t, err) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package mainnet | ||
|
||
// TODO: Specify allowed staking tx hashes for v1 upgrade for mainnet | ||
const AllowedStakingTxHashesStr = `{ | ||
"tx_hashes": [ | ||
"90463a1e0b19137f07c304f2c1c79351fa6f97f1195f1f90dc0b3b57893a350d", | ||
"1db6de324beefd6870ec62a7385cac7144a43eba8e61fca202a8b41d963680ef" | ||
] | ||
}` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package testnet | ||
|
||
// TODO: Specify allowed staking tx hashes for v1 upgrade for testnet | ||
const AllowedStakingTxHashesStr = `{ | ||
"tx_hashes": [ | ||
"a3572b22571b46b7688fbfe1e8aeee82bb772d52c5ddb069cda361dc33fb4191", | ||
"276a2b384614976c9a6a737f347e981b91f4dc269ee510a6f71e5eec9ecb903a" | ||
] | ||
}` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.