Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ jobs:
rustup component add rust-src clippy
- name: Install xargo
run: |
cd cosmwasm/enclaves/execute/
cargo --version
rustc --version
cargo +stable install xargo --version 0.3.25
pushd ~
git clone https://github.com/scrtlabs/xargo.git --branch fix
cd xargo
cargo install --path .
popd
xargo --version
- name: Test enclave
run: |
Expand Down Expand Up @@ -246,7 +251,11 @@ jobs:
cd cosmwasm/enclaves/execute/
cargo --version
rustc --version
cargo +stable install xargo --version 0.3.25
pushd ~
git clone https://github.com/scrtlabs/xargo.git --branch fix
cd xargo
cargo install --path .
popd
xargo --version
- name: Clippy
run: |
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ replace (
cosmossdk.io/api => github.com/scrtlabs/cosmos-sdk-api v0.7.6-secret.0
cosmossdk.io/store => github.com/scrtlabs/cosmos-sdk-store v1.1.1-secret.1
cosmossdk.io/x/tx => github.com/scrtlabs/cosmos-sdk-x-tx v0.13.7-secret.0
github.com/cometbft/cometbft => github.com/scrtlabs/tendermint v0.38.17-secret-6
github.com/cosmos/cosmos-sdk => github.com/scrtlabs/cosmos-sdk v0.50.14-secret.2
github.com/cometbft/cometbft => github.com/scrtlabs/tendermint v0.38.17-secret-8
github.com/cosmos/cosmos-sdk => github.com/scrtlabs/cosmos-sdk v0.50.14-secret.4
github.com/cosmos/iavl => github.com/scrtlabs/iavl v1.2.2-secret.0
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1609,8 +1609,8 @@ github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWR
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU=
github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U=
github.com/scrtlabs/cosmos-sdk v0.50.14-secret.2 h1:ZZtAeop8ObILDa9jMpm7OnqBzqkMlOFGK6fe0FIKouQ=
github.com/scrtlabs/cosmos-sdk v0.50.14-secret.2/go.mod h1:9b0JEhqRylg/qFe/TY47dcYZREHFmw1C2H9Hb+eYhyE=
github.com/scrtlabs/cosmos-sdk v0.50.14-secret.4 h1:YU8JJIC2LGoZ3Z8+ezgv8WI21XKxVPMOUjsbaPtw+yc=
github.com/scrtlabs/cosmos-sdk v0.50.14-secret.4/go.mod h1:otdpIqWbky7zjfzbcoAOHC0BwHruG9MWemfMx9f+rKk=
github.com/scrtlabs/cosmos-sdk-api v0.7.6-secret.0 h1:9IGLySVhC2qSrxT3fZvvqwjKsnXWSSKnywQDzT8y1Gs=
github.com/scrtlabs/cosmos-sdk-api v0.7.6-secret.0/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38=
github.com/scrtlabs/cosmos-sdk-store v1.1.1-secret.1 h1:TELtwBkSg0xBrs2ObFE0pVVWF6E31fPCDX2tk8OiJPo=
Expand All @@ -1619,8 +1619,8 @@ github.com/scrtlabs/cosmos-sdk-x-tx v0.13.7-secret.0 h1:i3k5706sDHKhaCvzokB+n33/
github.com/scrtlabs/cosmos-sdk-x-tx v0.13.7-secret.0/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w=
github.com/scrtlabs/iavl v1.2.2-secret.0 h1:P96PL1Lf8OBSW9pMrlaRxhceZ4z9Hc7jk12g9ShWeHw=
github.com/scrtlabs/iavl v1.2.2-secret.0/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw=
github.com/scrtlabs/tendermint v0.38.17-secret-6 h1:X06gihMRdhOtp5YWx03hhwsntcRrl43tu5N0SVXihqI=
github.com/scrtlabs/tendermint v0.38.17-secret-6/go.mod h1:v3Ig0sYd0ZzXf4V5A/M4PoBohQZYI9Wlg6gBALw1Qs8=
github.com/scrtlabs/tendermint v0.38.17-secret-8 h1:qHJwAlmBoK/sbbKgUCs1tFwoac11NaSBqcpIXdOsYlI=
github.com/scrtlabs/tendermint v0.38.17-secret-8/go.mod h1:v3Ig0sYd0ZzXf4V5A/M4PoBohQZYI9Wlg6gBALw1Qs8=
github.com/scrtlabs/tm-secret-enclave v1.13.0 h1:a2xH0G96chEM8Ntwlq/Fh36r4dg0ijKWTaOy0oqFsqg=
github.com/scrtlabs/tm-secret-enclave v1.13.0/go.mod h1:nxZQtzzAqBNBLOEXSv4cKlUnVA4vRmHOn6ujr3kxVME=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
Expand Down
40 changes: 19 additions & 21 deletions x/compute/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/scrtlabs/SecretNetwork/go-cosmwasm/api"
wasmtypes "github.com/scrtlabs/SecretNetwork/go-cosmwasm/types"
"github.com/scrtlabs/SecretNetwork/x/compute/client/cli"
"github.com/scrtlabs/SecretNetwork/x/compute/internal/keeper"
"github.com/scrtlabs/SecretNetwork/x/compute/internal/types"
crontypes "github.com/scrtlabs/SecretNetwork/x/cron/types"
tmenclave "github.com/scrtlabs/tm-secret-enclave"
)

Expand Down Expand Up @@ -161,13 +159,13 @@ func (am AppModule) BeginBlock(c context.Context) error {
ctx := c.(sdk.Context)
block_header := ctx.BlockHeader()

execCronMsgs, bytesCronMsgs, err := am.keeper.GetScheduledMsgs(ctx, crontypes.ExecutionStage_EXECUTION_STAGE_BEGIN_BLOCKER)
if err != nil {
ctx.Logger().Error("Failed to get scheduled cron msgs")
return err
}
// execCronMsgs, bytesCronMsgs, err := am.keeper.GetScheduledMsgs(ctx, crontypes.ExecutionStage_EXECUTION_STAGE_BEGIN_BLOCKER)
// if err != nil {
// ctx.Logger().Error("Failed to get scheduled cron msgs")
// return err
// }

cron_msgs := tm_type.Data{Txs: bytesCronMsgs}
cron_msgs := tm_type.Data{Txs: [][]byte{}}
cron_data, err := cron_msgs.Marshal()
if err != nil {
ctx.Logger().Error("Failed to marshal cron_msgs")
Expand Down Expand Up @@ -202,13 +200,13 @@ func (am AppModule) BeginBlock(c context.Context) error {
return err
}

for idx, msg := range execCronMsgs {
ctx = ctx.WithTxBytes(bytesCronMsgs[idx])
_, err := am.keeper.Execute(ctx, msg.Contract, msg.Sender, msg.Msg, msg.SentFunds, msg.CallbackSig, wasmtypes.HandleTypeExecute)
if err != nil {
ctx.Logger().Error("Failed to execute cron message", "error", err)
}
}
// for idx, msg := range execCronMsgs {
// ctx = ctx.WithTxBytes(bytesCronMsgs[idx])
// _, err := am.keeper.Execute(ctx, msg.Contract, msg.Sender, msg.Msg, msg.SentFunds, msg.CallbackSig, wasmtypes.HandleTypeExecute)
// if err != nil {
// ctx.Logger().Error("Failed to execute cron message", "error", err)
// }
// }

am.keeper.SetRandomSeed(ctx, random, validator_set_evidence)
} else {
Expand All @@ -221,13 +219,13 @@ func (am AppModule) BeginBlock(c context.Context) error {
func (am AppModule) EndBlock(c context.Context) error {
ctx := c.(sdk.Context)

_, bytesCronMsgs, err := am.keeper.GetScheduledMsgs(ctx, crontypes.ExecutionStage_EXECUTION_STAGE_END_BLOCKER)
if err != nil {
ctx.Logger().Error("Failed to get scheduled cron msgs")
return err
}
// _, _, err := am.keeper.GetScheduledMsgs(ctx, crontypes.ExecutionStage_EXECUTION_STAGE_END_BLOCKER)
// if err != nil {
// ctx.Logger().Error("Failed to get scheduled cron msgs")
// return err
// }

cron_msgs := tm_type.Data{Txs: bytesCronMsgs}
cron_msgs := tm_type.Data{Txs: [][]byte{}}
cron_data, err := cron_msgs.Marshal()
if err != nil {
ctx.Logger().Error("Failed to marshal cron_msgs")
Expand Down
Loading