Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rc/v1.7.next1 #436

Draft
wants to merge 78 commits into
base: rc/v1.7.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
80471cb
support for relayed v3
sstanculeanu Oct 9, 2023
f428320
Merge pull request #396 from multiversx/relayedv3
sstanculeanu Oct 11, 2023
627293e
single inner tx
sstanculeanu Oct 27, 2023
a2e64d2
Merge pull request #402 from multiversx/single_inner_tx
sstanculeanu Oct 27, 2023
e3a223e
Merge branch 'rc/v1.7.0' of https://github.com/multiversx/mx-chain-pr…
sstanculeanu Nov 27, 2023
d934b6e
Merge pull request #413 from multiversx/merge_rc170_into_feat_relayed…
sstanculeanu Nov 27, 2023
990158e
added support for wild card in tx pool request by sender
sstanculeanu Mar 11, 2024
98d80d1
Merge branch 'rc/v1.7.next1' into support_for_tx_pool_wild_card
sstanculeanu Mar 14, 2024
de87bbc
Merge pull request #432 from multiversx/support_for_tx_pool_wild_card
sstanculeanu Mar 14, 2024
7b6c18f
Merge branch 'rc/v1.7.next1' of https://github.com/multiversx/mx-chai…
sstanculeanu Apr 4, 2024
089e1ae
Merge pull request #438 from multiversx/merge_rc17next1_into_feat_rel…
iulianpascalau Apr 5, 2024
826a1ae
multiple inner txs on relayed v3
sstanculeanu Apr 5, 2024
8164c11
Merge branch 'feat/relayedv3' of https://github.com/multiversx/mx-cha…
sstanculeanu Apr 5, 2024
7f6d688
Merge branch 'rc/v1.7.0' of https://github.com/multiversx/mx-chain-pr…
sstanculeanu May 9, 2024
6956918
updated deps after merge
sstanculeanu May 9, 2024
7dc1b4f
Merge pull request #441 from multiversx/merge_rc170_into_rc17next1_20…
sstanculeanu May 10, 2024
991ef5c
Merge pull request #408 from multiversx/rc/v1.7.0
iulianpascalau May 10, 2024
fbe7165
updated core-go + process-status support for v3
sstanculeanu May 28, 2024
79e98bc
fixed process-status on relayed v1 with move balance
sstanculeanu May 28, 2024
3f9f7fc
merged logs from destination on relayed tx v3 get transaction
sstanculeanu May 29, 2024
f2a0280
added unittest for relayed v3 merge of scr events
sstanculeanu May 30, 2024
ebebce0
Merge pull request #442 from multiversx/fix_process_status_on_relayed_v1
sstanculeanu May 30, 2024
bd24a18
fix process status returning failed instead of pending
sstanculeanu May 30, 2024
04c644f
added proper return on /process-status for un-executable relayed move…
sstanculeanu Jun 3, 2024
3813d38
fix after review
sstanculeanu Jun 4, 2024
511887e
Merge pull request #443 from multiversx/fix_process_status_for_relaye…
sstanculeanu Jun 4, 2024
5d2bae0
Merge branch 'rc/v1.7.next1' of https://github.com/multiversx/mx-chai…
sstanculeanu Jun 5, 2024
caf3d97
Merge pull request #444 from multiversx/merge_rc17next1_into_feat_rel…
sstanculeanu Jun 5, 2024
0b84d1d
Merge branch 'feat/relayedv3' of https://github.com/multiversx/mx-cha…
sstanculeanu Jun 5, 2024
e60a623
go mod tidy after merge
sstanculeanu Jun 5, 2024
87b3976
fixes after merge
sstanculeanu Jun 5, 2024
935bdb3
fixes after review
sstanculeanu Jun 13, 2024
507170f
Update actions workflow to support multi-architecture docker image bu…
danidrasovean Jun 17, 2024
1db7ecd
Merge pull request #445 from multiversx/multi-arch-docker-build
danidrasovean Jun 18, 2024
b28ae65
fix /process-status returning incorrect failed tx with gas refund
sstanculeanu Jun 19, 2024
ebbe837
fix /process-status returning incorrect pending tx for issue which ge…
sstanculeanu Jul 2, 2024
dc3cc55
/process-status now returns success for relayed v3
sstanculeanu Jul 3, 2024
0283601
update deps
sstanculeanu Jul 3, 2024
551788b
Merge pull request #439 from multiversx/multiple_inner_txs
sstanculeanu Jul 3, 2024
f599657
update deps
sstanculeanu Jul 3, 2024
329b4d7
Merge pull request #447 from multiversx/update_deps
sstanculeanu Jul 3, 2024
6657635
fix invalid address errors
sstanculeanu Jul 4, 2024
e52d7d1
remove provided string
sstanculeanu Jul 4, 2024
d45d1ee
Merge pull request #412 from multiversx/feat/relayedv3
AdoAdoAdo Jul 19, 2024
8812b9b
Merge branch 'master' of https://github.com/multiversx/mx-chain-proxy…
sstanculeanu Jul 25, 2024
9a6b0bb
updated deps after merge
sstanculeanu Jul 25, 2024
36661a3
Merge pull request #451 from multiversx/merge_master_into_rc17next1_2…
sstanculeanu Jul 25, 2024
f6267ba
process status fix for adding nil values on logs
sstanculeanu Jul 26, 2024
dd7d971
updated deps
sstanculeanu Jul 29, 2024
6a91405
Merge pull request #453 from multiversx/update_deps
sstanculeanu Jul 29, 2024
2487bb1
Remove code for address/:address/transactions
danielailie Aug 1, 2024
39b655c
Add empty new line at the and of file
danielailie Aug 1, 2024
e8a085a
fix swagger esdts roles endpoint
ssd04 Aug 1, 2024
1972e27
Merge pull request #455 from multiversx/fix-swagger-esdts-roles-endpoint
ssd04 Aug 1, 2024
bfc6ed9
Merge branch 'rc/v1.7.next1' into MX-15698-remove-deprecated-endpoint…
andreibancioiu Aug 2, 2024
ceb38a0
Merge pull request #454 from multiversx/MX-15698-remove-deprecated-en…
danielailie Aug 5, 2024
9215ab0
Merge branch 'rc/v1.7.next1' into fix_process_status
miiu96 Aug 5, 2024
d2dea9c
Remove code that serves endpoint /block-atlas
danielailie Aug 5, 2024
980d416
Remove whitespaces
danielailie Aug 5, 2024
0e75611
Merge pull request #457 from multiversx/MX-15699-remove-from-proxy-th…
danielailie Aug 8, 2024
7865fa5
Replaced 'hash' with 'nonce' in get-by-nonce description
danidrasovean Aug 9, 2024
a9f6e32
Merge pull request #458 from multiversx/fix-description-by-nonce
danidrasovean Aug 9, 2024
b06b627
Fix get transaction endpoint (#456)
miiu96 Aug 14, 2024
f037f05
Merge branch 'rc/v1.7.next1' into fix_process_status
sstanculeanu Aug 20, 2024
05fcff7
Merge branch 'rc/v1.7.next1' into fix_invalid_address_errors
sstanculeanu Aug 20, 2024
c84db03
Merge pull request #448 from multiversx/fix_invalid_address_errors
sstanculeanu Aug 20, 2024
4147f75
Merge branch 'rc/v1.7.next1' into fix_process_status
sstanculeanu Aug 20, 2024
357efad
Merge pull request #452 from multiversx/fix_process_status
sstanculeanu Aug 20, 2024
c9cc5f5
configurable number of shards
sstanculeanu Sep 4, 2024
05660f8
fix shard coordinator initialization
sstanculeanu Sep 4, 2024
fa067f8
fixes after review
sstanculeanu Sep 4, 2024
3232090
Merge pull request #460 from multiversx/configurable_number_of_shards
sstanculeanu Sep 4, 2024
e72a68e
Relayed tx v3 process status fix (#461)
miiu96 Sep 9, 2024
b9b92e5
updated deps to new tags
sstanculeanu Sep 9, 2024
480651a
Merge pull request #462 from multiversx/new_tags
sstanculeanu Sep 9, 2024
1763fd1
get number of shards from observers
sstanculeanu Sep 30, 2024
2e35868
fixes after review
sstanculeanu Oct 1, 2024
c170a4c
Merge pull request #463 from multiversx/get_number_of_shards_from_obs…
sstanculeanu Oct 3, 2024
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
45 changes: 29 additions & 16 deletions .github/workflows/deploy-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ name: Build Docker image & push
on:
release:
types: [published]
pull_request:

jobs:
build-docker-image:
Expand All @@ -17,19 +18,31 @@ jobs:

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}

- name: Build image
run: |
TAG_VERSION=${{ steps.get_version.outputs.VERSION }}
cd ${GITHUB_WORKSPACE} && docker build -t "${REGISTRY_HOSTNAME}/${IMAGE_NODE}:${TAG_VERSION}" -f ./docker/Dockerfile .
- name: Push image
run: |
docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password ${{ secrets.DOCKERHUB_TOKEN }}
TAG_VERSION=${{ steps.get_version.outputs.VERSION }}
docker push "${REGISTRY_HOSTNAME}/${IMAGE_NODE}:${TAG_VERSION}"
docker logout
uses: actions/checkout@v4

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_HOSTNAME }}/${{ env.IMAGE_NODE }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log into Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push image to Docker Hub
id: push
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@

.idea/
vendor/
cmd/proxy/proxy
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ For more details, go [here](https://docs.multiversx.com/sdk-and-tools/proxy/).
- `/v1.0/address/:address/shard` (GET) --> returns the shard of an :address based on current proxy's configuration.
- `/v1.0/address/:address/keys ` (GET) --> returns the key-value pairs of an :address.
- `/v1.0/address/:address/storage/:key` (GET) --> returns the value for a given key for an account.
- `/v1.0/address/:address/transactions` (GET) --> returns the transactions stored in indexer for a given :address.
- `/v1.0/address/:address/esdt` (GET) --> returns the account's ESDT tokens list for the given :address.
- `/v1.0/address/:address/esdt/:tokenIdentifier` (GET) --> returns the token data for a given :address and ESDT token, such as balance and properties.
- `/v1.0/address/:address/esdts-with-role/:role` (GET) --> returns the token identifiers for a given :address and the provided role.
Expand Down Expand Up @@ -83,11 +82,6 @@ Please note that `altered-accounts` endpoints will only work if the backing obse

- `/v1.0/blocks/by-round/:round` (GET) --> returns all blocks by round

### block-atlas

- `/v1.0/block-atlas/:shard/:nonce` (GET) --> returns a block by nonce, as required by Block Atlas


### hyperblock

- `/v1.0/hyperblock/by-nonce/:nonce` (GET) --> returns a hyperblock by nonce, with transactions included
Expand Down
6 changes: 0 additions & 6 deletions api/apiHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ func initBaseGroupsWithFacade(facade data.FacadeHandler) (map[string]data.GroupH
return nil, err
}

blockAtlasGroup, err := groups.NewBlockAtlasGroup(facade)
if err != nil {
return nil, err
}

hyperBlocksGroup, err := groups.NewHyperBlockGroup(facade)
if err != nil {
return nil, err
Expand Down Expand Up @@ -110,7 +105,6 @@ func initBaseGroupsWithFacade(facade data.FacadeHandler) (map[string]data.GroupH
"/block": blockGroup,
"/blocks": blocksGroup,
"/internal": internalGroup,
"/block-atlas": blockAtlasGroup,
"/hyperblock": hyperBlocksGroup,
"/network": networkGroup,
"/node": nodeGroup,
Expand Down
9 changes: 6 additions & 3 deletions api/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,23 @@ var ErrInvalidSignatureHex = errors.New("invalid signature, could not decode hex
var ErrInvalidGuardianSignatureHex = errors.New("invalid guardian signature, could not decode hex value")

// ErrInvalidGuardianAddress signals a wrong format for receiver address was provided
var ErrInvalidGuardianAddress = errors.New("invalid hex receiver address provided")
var ErrInvalidGuardianAddress = errors.New("invalid guardian address")

// ErrTxGenerationFailed signals an error generating a transaction
var ErrTxGenerationFailed = errors.New("transaction generation failed")

// ErrInvalidSenderAddress signals a wrong format for sender address was provided
var ErrInvalidSenderAddress = errors.New("invalid hex sender address provided")
var ErrInvalidSenderAddress = errors.New("invalid sender address")

// ErrInvalidReceiverAddress signals a wrong format for receiver address was provided
var ErrInvalidReceiverAddress = errors.New("invalid hex receiver address provided")
var ErrInvalidReceiverAddress = errors.New("invalid receiver address")

// ErrTransactionNotFound signals that a transaction was not found
var ErrTransactionNotFound = errors.New("transaction not found")

// ErrSCRsNoFound signals that smart contract results were not found
var ErrSCRsNoFound = errors.New("smart contract results not found")

// ErrTransactionsNotFoundInPool signals that no transaction was not found in pool
var ErrTransactionsNotFoundInPool = errors.New("transactions not found in pool")

Expand Down
22 changes: 0 additions & 22 deletions api/groups/baseAccountsGroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func NewAccountsGroup(facadeHandler data.FacadeHandler) (*accountsGroup, error)
{Path: "/:address/nonce", Handler: ag.getNonce, Method: http.MethodGet},
{Path: "/:address/shard", Handler: ag.getShard, Method: http.MethodGet},
{Path: "/:address/code-hash", Handler: ag.getCodeHash, Method: http.MethodGet},
{Path: "/:address/transactions", Handler: ag.getTransactions, Method: http.MethodGet},
{Path: "/:address/keys", Handler: ag.getKeyValuePairs, Method: http.MethodGet},
{Path: "/:address/key/:key", Handler: ag.getValueForKey, Method: http.MethodGet},
{Path: "/:address/esdt", Handler: ag.getESDTTokens, Method: http.MethodGet},
Expand Down Expand Up @@ -71,16 +70,6 @@ func (group *accountsGroup) respondWithAccount(c *gin.Context, transform func(*d
shared.RespondWith(c, http.StatusOK, response, "", data.ReturnCodeSuccess)
}

func (group *accountsGroup) getTransactionsFromFacade(c *gin.Context) ([]data.DatabaseTransaction, int, error) {
addr := c.Param("address")
transactions, err := group.facade.GetTransactions(addr)
if err != nil {
return nil, http.StatusInternalServerError, err
}

return transactions, http.StatusOK, nil
}

// getAccount returns an accountResponse containing information
// about the account correlated with provided address
func (group *accountsGroup) getAccount(c *gin.Context) {
Expand Down Expand Up @@ -157,17 +146,6 @@ func (group *accountsGroup) getAccounts(c *gin.Context) {
shared.RespondWith(c, http.StatusOK, response, "", data.ReturnCodeSuccess)
}

// getTransactions returns the transactions for the address parameter
func (group *accountsGroup) getTransactions(c *gin.Context) {
transactions, status, err := group.getTransactionsFromFacade(c)
if err != nil {
shared.RespondWith(c, status, nil, err.Error(), data.ReturnCodeInternalError)
return
}

shared.RespondWith(c, http.StatusOK, gin.H{"transactions": transactions}, "", data.ReturnCodeSuccess)
}

// getKeyValuePairs returns the key-value pairs for the address parameter
func (group *accountsGroup) getKeyValuePairs(c *gin.Context) {
addr := c.Param("address")
Expand Down
58 changes: 0 additions & 58 deletions api/groups/baseBlockAtlasGroup.go

This file was deleted.

132 changes: 0 additions & 132 deletions api/groups/baseBlockAtlasGroup_test.go

This file was deleted.

4 changes: 2 additions & 2 deletions api/groups/baseBlockGroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func TestGetBlockByNonce_ReturnsSuccessfully(t *testing.T) {
resp := httptest.NewRecorder()
ws.ServeHTTP(resp, req)

apiResp := blockResponse{}
apiResp := data.BlockApiResponse{}
loadResponse(resp.Body, &apiResp)

assert.Equal(t, http.StatusOK, resp.Code)
Expand Down Expand Up @@ -258,7 +258,7 @@ func TestGetBlockByHash_ReturnsSuccessfully(t *testing.T) {
resp := httptest.NewRecorder()
ws.ServeHTTP(resp, req)

apiResp := blockResponse{}
apiResp := data.BlockApiResponse{}
loadResponse(resp.Body, &apiResp)

assert.Equal(t, http.StatusOK, resp.Code)
Expand Down
4 changes: 4 additions & 0 deletions api/groups/baseTransactionGroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ func validateOptions(options common.TransactionsPoolOptions) error {
return errors.ErrEmptySenderToGetNonceGaps
}

if options.Fields == "*" {
return nil
}

if options.Fields != "" {
return validateFields(options.Fields)
}
Expand Down
1 change: 1 addition & 0 deletions api/groups/baseTransactionGroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ func TestGetTransactionsPool_InvalidOptions(t *testing.T) {
t.Run("empty sender when fetching nonce gaps", testInvalidParameters("?nonce-gaps=true", apiErrors.ErrEmptySenderToGetNonceGaps))
t.Run("invalid fields - numeric", testInvalidParameters("?fields=123", apiErrors.ErrInvalidFields))
t.Run("invalid characters on fields", testInvalidParameters("?fields=_/+", apiErrors.ErrInvalidFields))
t.Run("fields + wild card", testInvalidParameters("?fields=nonce,sender,*", apiErrors.ErrInvalidFields))
}

func testInvalidParameters(path string, expectedErr error) func(t *testing.T) {
Expand Down
Loading
Loading